diff --git a/src/Graphics/Canvas.js b/src/Graphics/Canvas.js index 6c2cb0d..cbbd541 100644 --- a/src/Graphics/Canvas.js +++ b/src/Graphics/Canvas.js @@ -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() { diff --git a/src/Graphics/Canvas.purs b/src/Graphics/Canvas.purs index 0ae61e1..666dfd5 100644 --- a/src/Graphics/Canvas.purs +++ b/src/Graphics/Canvas.purs @@ -37,6 +37,7 @@ module Graphics.Canvas , canvasToDataURL , setLineWidth + , setLineDash , setFillStyle , setStrokeStyle , setShadowBlur @@ -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