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 @@ -236,6 +236,25 @@ setLineCap :: forall eff. LineCap -> Context2D -> Eff (canvas :: Canvas | eff) C
236236
237237Set the current line cap type.
238238
239+ #### ` LineJoin `
240+
241+ ``` purescript
242+ data LineJoin
243+ = BevelJoin
244+ | RoundJoin
245+ | MiterJoin
246+ ```
247+
248+ Enumerates the different types of line join
249+
250+ #### ` setLineJoin `
251+
252+ ``` purescript
253+ setLineJoin :: forall eff. LineJoin -> Context2D -> Eff (canvas :: Canvas | eff) Context2D
254+ ```
255+
256+ Set the current line join type.
257+
239258#### ` Composite `
240259
241260``` purescript
Original file line number Diff line number Diff line change @@ -155,6 +155,15 @@ exports.setLineCapImpl = function(cap) {
155155 } ;
156156} ;
157157
158+ exports . setLineJoinImpl = function ( join ) {
159+ return function ( ctx ) {
160+ return function ( ) {
161+ ctx . lineJoin = join ;
162+ return ctx ;
163+ } ;
164+ } ;
165+ } ;
166+
158167exports . setGlobalCompositeOperationImpl = function ( ctx ) {
159168 return function ( op ) {
160169 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 ()
@@ -45,6 +46,7 @@ module Graphics.Canvas
4546 , setMiterLimit
4647
4748 , setLineCap
49+ , setLineJoin
4850 , setGlobalCompositeOperation
4951 , setGlobalAlpha
5052
@@ -217,6 +219,19 @@ setLineCap Round = setLineCapImpl "round"
217219setLineCap Square = setLineCapImpl " square"
218220setLineCap Butt = setLineCapImpl " butt"
219221
222+ -- Note that we can't re-use `Round` from LineCap, so I've added `Join` to all of these
223+
224+ -- | Enumerates the different types of line join
225+ data LineJoin = BevelJoin | RoundJoin | MiterJoin
226+
227+ foreign import setLineJoinImpl :: forall eff . String -> Context2D -> Eff (canvas :: Canvas | eff ) Context2D
228+
229+ -- | Set the current line join type.
230+ setLineJoin :: forall eff . LineJoin -> Context2D -> Eff (canvas :: Canvas | eff ) Context2D
231+ setLineJoin BevelJoin = setLineJoinImpl " bevel"
232+ setLineJoin RoundJoin = setLineJoinImpl " round"
233+ setLineJoin MiterJoin = setLineJoinImpl " miter"
234+
220235-- | Enumerates the different types of composite operations and blend modes.
221236data Composite
222237 -- Composite Operations
You can’t perform that action at this time.
0 commit comments