Skip to content

Commit ea4dcf1

Browse files
committed
fix
1 parent 89d4f12 commit ea4dcf1

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

src/Graphics/Canvas.purs

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -228,23 +228,35 @@ data Composite
228228
| Xor
229229

230230
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"
242242

243243
foreign import setGlobalCompositeOperationImpl :: forall eff. Context2D -> String -> Eff (canvas :: Canvas | eff) Context2D
244244

245245
-- | Set the current composite operation.
246246
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"
248260

249261
-- | Set the current global alpha level.
250262
foreign import setGlobalAlpha :: forall eff. Context2D -> Number -> Eff (canvas :: Canvas | eff) Context2D

0 commit comments

Comments
 (0)