Merge pull request #497 from treeform/guzba

fix smooth draw fuzz
This commit is contained in:
Andre von Houck 2022-08-09 15:51:40 -07:00 committed by GitHub
commit d88da02bd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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: