File tree Expand file tree Collapse file tree 3 files changed +43
-0
lines changed Expand file tree Collapse file tree 3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -228,6 +228,25 @@ setLineCap :: forall eff. LineCap -> Context2D -> Eff (canvas :: Canvas | eff) C
228228
229229Set the current line cap type.
230230
231+ #### ` LineJoin `
232+
233+ ``` purescript
234+ data LineJoin
235+ = BevelJoin
236+ | RoundJoin
237+ | MiterJoin
238+ ```
239+
240+ Enumerates the different types of line join
241+
242+ #### ` setLineJoin `
243+
244+ ``` purescript
245+ setLineJoin :: forall eff. LineJoin -> Context2D -> Eff (canvas :: Canvas | eff) Context2D
246+ ```
247+
248+ Set the current line join type.
249+
231250#### ` Composite `
232251
233252``` purescript
Original file line number Diff line number Diff line change @@ -146,6 +146,15 @@ exports.setLineCapImpl = function(cap) {
146146 } ;
147147} ;
148148
149+ exports . setLineJoinImpl = function ( join ) {
150+ return function ( ctx ) {
151+ return function ( ) {
152+ ctx . lineJoin = join ;
153+ return ctx ;
154+ } ;
155+ } ;
156+ } ;
157+
149158exports . setGlobalCompositeOperationImpl = function ( ctx ) {
150159 return function ( op ) {
151160 return function ( ) {
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ module Graphics.Canvas
1111 , Composite (..)
1212 , Dimensions ()
1313 , LineCap (..)
14+ , LineJoin (..)
1415 , Rectangle ()
1516 , ScaleTransform ()
1617 , TextMetrics ()
@@ -44,6 +45,7 @@ module Graphics.Canvas
4445 , setShadowColor
4546
4647 , setLineCap
48+ , setLineJoin
4749 , setGlobalCompositeOperation
4850 , setGlobalAlpha
4951
@@ -213,6 +215,19 @@ setLineCap Round = setLineCapImpl "round"
213215setLineCap Square = setLineCapImpl " square"
214216setLineCap Butt = setLineCapImpl " butt"
215217
218+ -- Note that we can't re-use `Round` from LineCap, so I've added `Join` to all of these
219+
220+ -- | Enumerates the different types of line join
221+ data LineJoin = BevelJoin | RoundJoin | MiterJoin
222+
223+ foreign import setLineJoinImpl :: forall eff . String -> Context2D -> Eff (canvas :: Canvas | eff ) Context2D
224+
225+ -- | Set the current line join type.
226+ setLineJoin :: forall eff . LineJoin -> Context2D -> Eff (canvas :: Canvas | eff ) Context2D
227+ setLineJoin BevelJoin = setLineJoinImpl " bevel"
228+ setLineJoin RoundJoin = setLineJoinImpl " round"
229+ setLineJoin MiterJoin = setLineJoinImpl " miter"
230+
216231-- | Enumerates the different types of composite operations and blend modes.
217232data Composite
218233 -- Composite Operations
You can’t perform that action at this time.
0 commit comments