Fix #394 - zero width mask fill.
This commit is contained in:
parent
e0ab3829b1
commit
542c8e84fd
2 changed files with 18 additions and 0 deletions
|
@ -1679,6 +1679,9 @@ proc fillShapes(
|
||||||
pathHeight = min(mask.height, (bounds.y + bounds.h).int)
|
pathHeight = min(mask.height, (bounds.y + bounds.h).int)
|
||||||
partitioning = partitionSegments(segments, startY, pathHeight)
|
partitioning = partitionSegments(segments, startY, pathHeight)
|
||||||
|
|
||||||
|
if pathWidth == 0:
|
||||||
|
return
|
||||||
|
|
||||||
var
|
var
|
||||||
coverages = newSeq[uint8](pathWidth)
|
coverages = newSeq[uint8](pathWidth)
|
||||||
hits = newSeq[(float32, int16)](partitioning.maxEntryCount)
|
hits = newSeq[(float32, int16)](partitioning.maxEntryCount)
|
||||||
|
|
|
@ -675,3 +675,18 @@ block:
|
||||||
|
|
||||||
doAssertRaises PixieError:
|
doAssertRaises PixieError:
|
||||||
ctx.strokePolygon(vec2(0.0, 0.0), 0.0, 0)
|
ctx.strokePolygon(vec2(0.0, 0.0), 0.0, 0)
|
||||||
|
|
||||||
|
block:
|
||||||
|
# Test zero width image fill.
|
||||||
|
let
|
||||||
|
image = newImage(100, 100)
|
||||||
|
pathStr = "M0 0 L0 1 L0 0 Z"
|
||||||
|
color = rgba(255, 0, 0, 255)
|
||||||
|
image.fillPath(pathStr, color)
|
||||||
|
|
||||||
|
block:
|
||||||
|
# Test zero width mask fill.
|
||||||
|
let
|
||||||
|
mask = newMask(100, 100)
|
||||||
|
pathStr = "M0 0 L0 1 L0 0 Z"
|
||||||
|
mask.fillPath(pathStr)
|
||||||
|
|
Loading…
Reference in a new issue