Merge pull request #349 from guzba/master

3.1.1 bugfix out of bounds
This commit is contained in:
treeform 2021-12-16 11:35:16 -08:00 committed by GitHub
commit cbd3af9024
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

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

View file

@ -750,6 +750,10 @@ proc drawUber(
xStart = xStart.clamp(0, a.width)
xStop = xStop.clamp(0, a.width)
# Skip this row if there is nothing in-bounds to draw
if xStart == a.width or xStop == 0:
continue
if blendMode == bmMask:
if xStart > 0:
zeroMem(a.data[a.dataIndex(0, y)].addr, 4 * xStart)