From 2c6617f0a0c952a958f8a7562b7189d9df999205 Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Wed, 8 Jun 2022 18:36:40 -0500 Subject: [PATCH] early exit --- src/pixie/images.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pixie/images.nim b/src/pixie/images.nim index a99c62d..fb68d62 100644 --- a/src/pixie/images.nim +++ b/src/pixie/images.nim @@ -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: