Merge pull request #396 from treeform/dev
Fix #394 - zero width mask fill.
This commit is contained in:
commit
aeda891540
2 changed files with 18 additions and 0 deletions
|
@ -1679,6 +1679,9 @@ proc fillShapes(
|
|||
pathHeight = min(mask.height, (bounds.y + bounds.h).int)
|
||||
partitioning = partitionSegments(segments, startY, pathHeight)
|
||||
|
||||
if pathWidth == 0:
|
||||
return
|
||||
|
||||
var
|
||||
coverages = newSeq[uint8](pathWidth)
|
||||
hits = newSeq[(float32, int16)](partitioning.maxEntryCount)
|
||||
|
|
|
@ -675,3 +675,18 @@ block:
|
|||
|
||||
doAssertRaises PixieError:
|
||||
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