File tree 3 files changed +43
-0
lines changed
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
236
236
237
237
Set the current line cap type.
238
238
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
+
239
258
#### ` Composite `
240
259
241
260
``` purescript
Original file line number Diff line number Diff line change @@ -155,6 +155,15 @@ exports.setLineCapImpl = function(cap) {
155
155
} ;
156
156
} ;
157
157
158
+ exports . setLineJoinImpl = function ( join ) {
159
+ return function ( ctx ) {
160
+ return function ( ) {
161
+ ctx . lineJoin = join ;
162
+ return ctx ;
163
+ } ;
164
+ } ;
165
+ } ;
166
+
158
167
exports . setGlobalCompositeOperationImpl = function ( ctx ) {
159
168
return function ( op ) {
160
169
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 ()
@@ -45,6 +46,7 @@ module Graphics.Canvas
45
46
, setMiterLimit
46
47
47
48
, setLineCap
49
+ , setLineJoin
48
50
, setGlobalCompositeOperation
49
51
, setGlobalAlpha
50
52
@@ -217,6 +219,19 @@ setLineCap Round = setLineCapImpl "round"
217
219
setLineCap Square = setLineCapImpl " square"
218
220
setLineCap Butt = setLineCapImpl " butt"
219
221
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
+
220
235
-- | Enumerates the different types of composite operations and blend modes.
221
236
data Composite
222
237
-- Composite Operations
You can’t perform that action at this time.
0 commit comments