@@ -228,23 +228,35 @@ data Composite
228
228
| Xor
229
229
230
230
instance showComposite :: Show Composite where
231
- show SourceOver = " source-over "
232
- show SourceIn = " source-in "
233
- show SourceOut = " source-out "
234
- show SourceAtop = " source-atop "
235
- show DestinationOver = " destination-over "
236
- show DestinationIn = " destination-in "
237
- show DestinationOut = " destination-out "
238
- show DestinationAtop = " destination-atop "
239
- show Lighter = " lighter "
240
- show Copy = " copy "
241
- show Xor = " xor "
231
+ show SourceOver = " SourceOver "
232
+ show SourceIn = " SourceIn "
233
+ show SourceOut = " SourceOut "
234
+ show SourceAtop = " SourceAtop "
235
+ show DestinationOver = " DestinationOver "
236
+ show DestinationIn = " DestinationIn "
237
+ show DestinationOut = " DestinationOut "
238
+ show DestinationAtop = " DestinationAtop "
239
+ show Lighter = " Lighter "
240
+ show Copy = " Copy "
241
+ show Xor = " Xor "
242
242
243
243
foreign import setGlobalCompositeOperationImpl :: forall eff . Context2D -> String -> Eff (canvas :: Canvas | eff ) Context2D
244
244
245
245
-- | Set the current composite operation.
246
246
setGlobalCompositeOperation :: forall eff . Context2D -> Composite -> Eff (canvas :: Canvas | eff ) Context2D
247
- setGlobalCompositeOperation ctx composite = setGlobalCompositeOperationImpl ctx (show composite)
247
+ setGlobalCompositeOperation ctx composite = setGlobalCompositeOperationImpl ctx (toString composite)
248
+ where
249
+ toString SourceOver = " source-over"
250
+ toString SourceIn = " source-in"
251
+ toString SourceOut = " source-out"
252
+ toString SourceAtop = " source-atop"
253
+ toString DestinationOver = " destination-over"
254
+ toString DestinationIn = " destination-in"
255
+ toString DestinationOut = " destination-out"
256
+ toString DestinationAtop = " destination-atop"
257
+ toString Lighter = " lighter"
258
+ toString Copy = " copy"
259
+ toString Xor = " xor"
248
260
249
261
-- | Set the current global alpha level.
250
262
foreign import setGlobalAlpha :: forall eff . Context2D -> Number -> Eff (canvas :: Canvas | eff ) Context2D
0 commit comments