diff --git a/CHANGELOG.md b/CHANGELOG.md index dfc9cb6..6be1fff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Notable changes to this project are documented in this file. The format is based Breaking changes: - Migrate FFI to ES modules (#85 by @JordanMartinez) +- Support arcs that are drawn counter-clockwise (#58, #83 by @karljs and @JordanMartinez) New features: - Added `createImageDataWith` (#81) diff --git a/src/Graphics/Canvas.js b/src/Graphics/Canvas.js index b57a01c..37f49d0 100644 --- a/src/Graphics/Canvas.js +++ b/src/Graphics/Canvas.js @@ -227,7 +227,7 @@ export function closePath(ctx) { export function arc(ctx) { return function(a) { return function() { - ctx.arc(a.x, a.y, a.radius, a.start, a.end); + ctx.arc(a.x, a.y, a.radius, a.start, a.end, a.useCounterClockwise); }; }; } diff --git a/src/Graphics/Canvas.purs b/src/Graphics/Canvas.purs index 1d0d6a1..9d29d70 100644 --- a/src/Graphics/Canvas.purs +++ b/src/Graphics/Canvas.purs @@ -415,12 +415,15 @@ fillPath ctx path = do -- | - The center coordinates `x` and `y`, -- | - The radius `r`, -- | - The starting and ending angles, `start` and `end`. +-- | - Whether to draw the arc counter-clockwise (true) or clockwise (false) direction. +-- | Normally, this value is `false`. type Arc = { x :: Number , y :: Number , radius :: Number , start :: Number , end :: Number + , useCounterClockwise :: Boolean } -- | Render an arc object.