Break out of both loops.

This commit is contained in:
treeform 2020-12-02 23:05:37 -08:00
parent 547f321233
commit 13092aef5e

View file

@ -365,6 +365,7 @@ proc spread*(image: Image, spread: float32): Image =
for y in 0 ..< result.height:
for x in 0 ..< result.width:
var maxAlpha = 0.uint8
block blurBox:
for bx in -spread.int .. spread.int:
for by in -spread.int .. spread.int:
# if vec2(bx.float32, by.float32).length < spread:
@ -372,7 +373,7 @@ proc spread*(image: Image, spread: float32): Image =
if alpha > maxAlpha:
maxAlpha = alpha
if maxAlpha == 255:
break
break blurBox
result[x, y] = rgba(0, 0, 0, maxAlpha)
proc shadow*(