diff --git a/README.md b/README.md index bd4f215..c489a84 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,8 @@ clip :: forall eff. Context2D -> Eff (canvas :: Canvas | eff) Context2D + closePath :: forall eff. Context2D -> Eff (canvas :: Canvas | eff) Context2D + fill :: forall eff. Context2D -> Eff (canvas :: Canvas | eff) Context2D fillPath :: forall eff a. Context2D -> Eff (canvas :: Canvas | eff) a -> Eff (canvas :: Canvas | eff) a diff --git a/src/Graphics/Canvas.purs b/src/Graphics/Canvas.purs index 790310e..9a493e3 100644 --- a/src/Graphics/Canvas.purs +++ b/src/Graphics/Canvas.purs @@ -156,6 +156,14 @@ foreign import moveTo \ };\ \}" :: forall eff. Context2D -> Number -> Number -> Eff (canvas :: Canvas | eff) Context2D +foreign import closePath + "function closePath(ctx) {\ + \ return function() {\ + \ ctx.closePath();\ + \ return ctx;\ + \ };\ + \}" :: forall eff. Context2D -> Eff (canvas :: Canvas | eff) Context2D + strokePath :: forall eff a. Context2D -> Eff (canvas :: Canvas | eff) a -> Eff (canvas :: Canvas | eff) a strokePath ctx path = do beginPath ctx