address todo

This commit is contained in:
Ryan Oldenburg 2020-12-04 12:42:39 -06:00
parent da351692d8
commit 4536baeefd

View file

@ -648,11 +648,10 @@ proc fillPolygons*(
inc curHit inc curHit
alphas[x] += penEdge alphas[x] += penEdge
for x in 0 ..< result.width: for x in 0 ..< result.width:
var a = clamp(abs(alphas[x]) / float32(quality), 0.0, 1.0) let a = clamp(abs(alphas[x]) / float32(quality), 0.0, 1.0)
var colorWithAlpha = color var colorWithAlpha = color
colorWithAlpha.a = uint8(clamp(a, 0, 1) * 255.0) colorWithAlpha.a = uint8(a * 255.0)
result[x, y] = colorWithAlpha result.setRgbaUnsafe(x, y, colorWithAlpha)
# TODO: don't double-clamp and can probably be unsafe?
{.pop.} {.pop.}