diff --git a/docs/Graphics/Canvas.md b/docs/Graphics/Canvas.md index d0be550..0043c9a 100644 --- a/docs/Graphics/Canvas.md +++ b/docs/Graphics/Canvas.md @@ -209,6 +209,14 @@ setShadowOffsetY :: forall eff. Number -> Context2D -> Eff (canvas :: Canvas | e Set the current shadow y-offset. +#### `setMiterLimit` + +``` purescript +setMiterLimit :: forall eff. Number -> Context2D -> Eff (canvas :: Canvas | eff) Context2D +``` + +Set the current miter limit. + #### `LineCap` ``` purescript diff --git a/src/Graphics/Canvas.js b/src/Graphics/Canvas.js index f7113f4..f0d6c8b 100644 --- a/src/Graphics/Canvas.js +++ b/src/Graphics/Canvas.js @@ -137,6 +137,15 @@ exports.setShadowOffsetY = function(offsetY) { }; }; +exports.setMiterLimit = function(limit) { + return function(ctx) { + return function() { + ctx.miterLimit = limit; + return ctx; + }; + }; +}; + exports.setLineCapImpl = function(cap) { return function(ctx) { return function() { diff --git a/src/Graphics/Canvas.purs b/src/Graphics/Canvas.purs index 0029ec3..2e4b3a6 100644 --- a/src/Graphics/Canvas.purs +++ b/src/Graphics/Canvas.purs @@ -42,6 +42,7 @@ module Graphics.Canvas , setShadowOffsetX , setShadowOffsetY , setShadowColor + , setMiterLimit , setLineCap , setGlobalCompositeOperation @@ -202,6 +203,9 @@ foreign import setShadowOffsetX :: forall eff. Number -> Context2D -> Eff (canva -- | Set the current shadow y-offset. foreign import setShadowOffsetY :: forall eff. Number -> Context2D -> Eff (canvas :: Canvas | eff) Context2D +-- | Set the current miter limit. +foreign import setMiterLimit :: forall eff. Number -> Context2D -> Eff (canvas :: Canvas | eff) Context2D + -- | Enumerates the different types of line cap. data LineCap = Round | Square | Butt