Skip to content

Commit 221abb9

Browse files
Karl Smeltzerhdgarrood
Karl Smeltzer
authored andcommitted
implement setLineDash support (#56)
1 parent 3a5890c commit 221abb9

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/Graphics/Canvas.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ exports.setLineWidth = function(ctx) {
8181
};
8282
};
8383

84+
exports.setLineDash = function(ctx) {
85+
return function(dash) {
86+
return function() {
87+
ctx.setLineDash(dash);
88+
};
89+
};
90+
};
91+
8492
exports.setFillStyle = function(ctx) {
8593
return function(style) {
8694
return function() {

src/Graphics/Canvas.purs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ module Graphics.Canvas
3737
, canvasToDataURL
3838

3939
, setLineWidth
40+
, setLineDash
4041
, setFillStyle
4142
, setStrokeStyle
4243
, setShadowBlur
@@ -203,6 +204,9 @@ foreign import canvasToDataURL :: forall eff. CanvasElement -> Eff (canvas :: CA
203204
-- | Set the current line width.
204205
foreign import setLineWidth :: forall eff. Context2D -> Number -> Eff (canvas :: CANVAS | eff) Unit
205206

207+
-- | Set the current line dash pattern.
208+
foreign import setLineDash :: forall eff. Context2D -> Array Number -> Eff (canvas :: CANVAS | eff) Unit
209+
206210
-- | Set the current fill style/color.
207211
foreign import setFillStyle :: forall eff. Context2D -> String -> Eff (canvas :: CANVAS | eff) Unit
208212

0 commit comments

Comments
 (0)