early exit

This commit is contained in:
Ryan Oldenburg 2022-06-08 18:36:40 -05:00
parent 445043b11c
commit 2c6617f0a0

View file

@ -382,6 +382,8 @@ proc magnifyBy2*(image: Image, power = 1): Image {.raises: [PixieError].} =
proc applyOpacity*(target: Image | Mask, opacity: float32) {.raises: [].} =
## Multiplies alpha of the image by opacity.
let opacity = round(255 * opacity).uint16
if opacity == 255:
return
if opacity == 0:
when type(target) is Image: