3.1.2 bugfix
This commit is contained in:
parent
a8072c132a
commit
34d96df323
7 changed files with 44 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
version = "3.1.1"
|
||||
version = "3.1.2"
|
||||
author = "Andre von Houck and Ryan Oldenburg"
|
||||
description = "Full-featured 2d graphics library for Nim."
|
||||
license = "MIT"
|
||||
|
|
|
@ -1601,11 +1601,16 @@ proc fillShapes(
|
|||
bounds = computeBounds(segments).snapToPixels()
|
||||
startX = max(0, bounds.x.int)
|
||||
startY = max(0, bounds.y.int)
|
||||
pathWidth =
|
||||
if startX < image.width:
|
||||
min(bounds.w.int, image.width - startX)
|
||||
else:
|
||||
0
|
||||
pathHeight = min(image.height, (bounds.y + bounds.h).int)
|
||||
partitioning = partitionSegments(segments, startY, pathHeight - startY)
|
||||
|
||||
var
|
||||
coverages = newSeq[uint8](bounds.w.int)
|
||||
coverages = newSeq[uint8](pathWidth)
|
||||
hits = newSeq[(float32, int16)](partitioning.maxEntryCount)
|
||||
numHits: int
|
||||
aa: bool
|
||||
|
@ -1659,11 +1664,16 @@ proc fillShapes(
|
|||
bounds = computeBounds(segments).snapToPixels()
|
||||
startX = max(0, bounds.x.int)
|
||||
startY = max(0, bounds.y.int)
|
||||
pathWidth =
|
||||
if startX < mask.width:
|
||||
min(bounds.w.int, mask.width - startX)
|
||||
else:
|
||||
0
|
||||
pathHeight = min(mask.height, (bounds.y + bounds.h).int)
|
||||
partitioning = partitionSegments(segments, startY, pathHeight)
|
||||
|
||||
var
|
||||
coverages = newSeq[uint8](bounds.w.int)
|
||||
coverages = newSeq[uint8](pathWidth)
|
||||
hits = newSeq[(float32, int16)](partitioning.maxEntryCount)
|
||||
numHits: int
|
||||
aa: bool
|
||||
|
|
BIN
tests/paths/path0pxCover.png
Normal file
BIN
tests/paths/path0pxCover.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 313 B |
BIN
tests/paths/path1pxCover.png
Normal file
BIN
tests/paths/path1pxCover.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 315 B |
BIN
tests/paths/pathStroke1Big.png
Normal file
BIN
tests/paths/pathStroke1Big.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
BIN
tests/paths/pathStroke1BigMask.png
Normal file
BIN
tests/paths/pathStroke1BigMask.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 432 B |
|
@ -634,3 +634,34 @@ block:
|
|||
image.strokePath(path, paint, strokeWidth = 10)
|
||||
|
||||
image.writeFile("tests/paths/opacityStroke.png")
|
||||
|
||||
block:
|
||||
let
|
||||
image = newImage(100, 100)
|
||||
pathStr = "M0 0 L200 200"
|
||||
color = rgba(255, 0, 0, 255)
|
||||
image.strokePath(pathStr, color, strokeWidth = 10)
|
||||
image.writeFile("tests/paths/pathStroke1Big.png")
|
||||
|
||||
block:
|
||||
let
|
||||
image = newMask(100, 100)
|
||||
pathStr = "M0 0 L200 200"
|
||||
image.strokePath(pathStr, strokeWidth = 10)
|
||||
image.writeFile("tests/paths/pathStroke1BigMask.png")
|
||||
|
||||
block:
|
||||
let
|
||||
image = newImage(100, 100)
|
||||
pathStr = "M99 99 L999 99 L999 100 L99 100 Z"
|
||||
color = rgba(255, 0, 0, 255)
|
||||
image.fillPath(pathStr, color)
|
||||
image.writeFile("tests/paths/path1pxCover.png")
|
||||
|
||||
block:
|
||||
let
|
||||
image = newImage(100, 100)
|
||||
pathStr = "M100 100 L999 100 L999 101 L100 101 Z"
|
||||
color = rgba(255, 0, 0, 255)
|
||||
image.fillPath(pathStr, color)
|
||||
image.writeFile("tests/paths/path0pxCover.png")
|
||||
|
|
Loading…
Reference in a new issue