Skip to content

Commit

Permalink
implement setLineDash support (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
Karl Smeltzer authored and hdgarrood committed Jan 20, 2018
1 parent 3a5890c commit 221abb9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Graphics/Canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ exports.setLineWidth = function(ctx) {
};
};

exports.setLineDash = function(ctx) {
return function(dash) {
return function() {
ctx.setLineDash(dash);
};
};
};

exports.setFillStyle = function(ctx) {
return function(style) {
return function() {
Expand Down
4 changes: 4 additions & 0 deletions src/Graphics/Canvas.purs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ module Graphics.Canvas
, canvasToDataURL

, setLineWidth
, setLineDash
, setFillStyle
, setStrokeStyle
, setShadowBlur
Expand Down Expand Up @@ -203,6 +204,9 @@ foreign import canvasToDataURL :: forall eff. CanvasElement -> Eff (canvas :: CA
-- | Set the current line width.
foreign import setLineWidth :: forall eff. Context2D -> Number -> Eff (canvas :: CANVAS | eff) Unit

-- | Set the current line dash pattern.
foreign import setLineDash :: forall eff. Context2D -> Array Number -> Eff (canvas :: CANVAS | eff) Unit

-- | Set the current fill style/color.
foreign import setFillStyle :: forall eff. Context2D -> String -> Eff (canvas :: CANVAS | eff) Unit

Expand Down

0 comments on commit 221abb9

Please sign in to comment.