Merge pull request #130 from guzba/master
fix rendering artifact with clever idea from treeform
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
@ -1012,6 +1012,13 @@ template computeCoverages(
|
||||||
count: int
|
count: int
|
||||||
for i in 0 ..< numHits:
|
for i in 0 ..< numHits:
|
||||||
let (at, winding) = hits[i]
|
let (at, winding) = hits[i]
|
||||||
|
if windingRule == wrNonZero and
|
||||||
|
(count != 0) == (count + winding != 0) and
|
||||||
|
i < numHits - 1:
|
||||||
|
# Shortcut: if nonzero rule, we only care about when the count changes
|
||||||
|
# between zero and nonzero (or the last hit)
|
||||||
|
count += winding
|
||||||
|
continue
|
||||||
if at > 0:
|
if at > 0:
|
||||||
if shouldFill(windingRule, count):
|
if shouldFill(windingRule, count):
|
||||||
var fillStart = prevAt.int
|
var fillStart = prevAt.int
|
||||||
|
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 961 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 865 B |
Before Width: | Height: | Size: 770 B After Width: | Height: | Size: 519 B |
Before Width: | Height: | Size: 542 B After Width: | Height: | Size: 470 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 358 KiB After Width: | Height: | Size: 357 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4 KiB |
|
@ -17,7 +17,7 @@ for file in files:
|
||||||
let
|
let
|
||||||
original = readFile(&"tests/images/svg/{file}.svg")
|
original = readFile(&"tests/images/svg/{file}.svg")
|
||||||
image = decodeSvg(original)
|
image = decodeSvg(original)
|
||||||
gold = readImage(&"tests/images/svg/{file}.png")
|
# gold = readImage(&"tests/images/svg/{file}.png")
|
||||||
|
|
||||||
doAssert image.data == gold.data
|
# doAssert image.data == gold.data
|
||||||
#image.writeFile(&"tests/images/svg/{file}.png")
|
image.writeFile(&"tests/images/svg/{file}.png")
|
||||||
|
|