Skip to content

Commit d958bb7

Browse files
Finish PR 58 - Support counter-clockwise arcs (#83)
* Support counter-clockwise arcs * Update changelog
1 parent f0c6036 commit d958bb7

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Notable changes to this project are documented in this file. The format is based
66

77
Breaking changes:
88
- Migrate FFI to ES modules (#85 by @JordanMartinez)
9+
- Support arcs that are drawn counter-clockwise (#58, #83 by @karljs and @JordanMartinez)
910

1011
New features:
1112
- Added `createImageDataWith` (#81)

src/Graphics/Canvas.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ export function closePath(ctx) {
227227
export function arc(ctx) {
228228
return function(a) {
229229
return function() {
230-
ctx.arc(a.x, a.y, a.radius, a.start, a.end);
230+
ctx.arc(a.x, a.y, a.radius, a.start, a.end, a.useCounterClockwise);
231231
};
232232
};
233233
}

src/Graphics/Canvas.purs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,12 +415,15 @@ fillPath ctx path = do
415415
-- | - The center coordinates `x` and `y`,
416416
-- | - The radius `r`,
417417
-- | - The starting and ending angles, `start` and `end`.
418+
-- | - Whether to draw the arc counter-clockwise (true) or clockwise (false) direction.
419+
-- | Normally, this value is `false`.
418420
type Arc =
419421
{ x :: Number
420422
, y :: Number
421423
, radius :: Number
422424
, start :: Number
423425
, end :: Number
426+
, useCounterClockwise :: Boolean
424427
}
425428

426429
-- | Render an arc object.

0 commit comments

Comments
 (0)