fix smooth draw fuzz

This commit is contained in:
Ryan Oldenburg 2022-08-09 13:50:17 -05:00
parent 5022a8afe7
commit 6a2c5934f7
2 changed files with 4 additions and 1 deletions

View file

@ -1,4 +1,4 @@
version = "5.0.0"
version = "5.0.1"
author = "Andre von Houck and Ryan Oldenburg"
description = "Full-featured 2d graphics library for Nim."
license = "MIT"

View file

@ -582,6 +582,9 @@ proc drawSmooth(a, b: Image, transform: Mat3, blendMode: BlendMode) =
xStart = clamp(xMin.floor.int, 0, a.width)
xEnd = clamp(xMax.ceil.int, 0, a.width)
if xEnd - xStart == 0:
continue
var srcPos = p + dx * xStart.float32 + dy * y.float32
srcPos = vec2(srcPos.x - h, srcPos.y - h)
for x in xStart ..< xEnd: