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
228
228
229
229
Set the current line cap type.
230
230
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
+
231
250
#### ` Composite `
232
251
233
252
``` purescript
Original file line number Diff line number Diff line change @@ -146,6 +146,15 @@ exports.setLineCapImpl = function(cap) {
146
146
} ;
147
147
} ;
148
148
149
+ exports . setLineJoinImpl = function ( join ) {
150
+ return function ( ctx ) {
151
+ return function ( ) {
152
+ ctx . lineJoin = join ;
153
+ return ctx ;
154
+ } ;
155
+ } ;
156
+ } ;
157
+
149
158
exports . setGlobalCompositeOperationImpl = function ( ctx ) {
150
159
return function ( op ) {
151
160
return function ( ) {
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ module Graphics.Canvas
11
11
, Composite (..)
12
12
, Dimensions ()
13
13
, LineCap (..)
14
+ , LineJoin (..)
14
15
, Rectangle ()
15
16
, ScaleTransform ()
16
17
, TextMetrics ()
@@ -44,6 +45,7 @@ module Graphics.Canvas
44
45
, setShadowColor
45
46
46
47
, setLineCap
48
+ , setLineJoin
47
49
, setGlobalCompositeOperation
48
50
, setGlobalAlpha
49
51
@@ -213,6 +215,19 @@ setLineCap Round = setLineCapImpl "round"
213
215
setLineCap Square = setLineCapImpl " square"
214
216
setLineCap Butt = setLineCapImpl " butt"
215
217
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
+
216
231
-- | Enumerates the different types of composite operations and blend modes.
217
232
data Composite
218
233
-- Composite Operations
You can’t perform that action at this time.
0 commit comments