merge hits that stop and then continue filling without any gap
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
@ -1171,9 +1171,9 @@ iterator walk(
|
||||||
width: float32
|
width: float32
|
||||||
): (float32, float32, int) =
|
): (float32, float32, int) =
|
||||||
var
|
var
|
||||||
|
i, count: int
|
||||||
prevAt: float32
|
prevAt: float32
|
||||||
count: int
|
while i < numHits:
|
||||||
for i in 0 ..< numHits:
|
|
||||||
let (at, winding) = hits[i]
|
let (at, winding) = hits[i]
|
||||||
if windingRule == wrNonZero and
|
if windingRule == wrNonZero and
|
||||||
count != 0 and
|
count != 0 and
|
||||||
|
@ -1182,12 +1182,23 @@ iterator walk(
|
||||||
# Shortcut: if nonzero rule, we only care about when the count changes
|
# Shortcut: if nonzero rule, we only care about when the count changes
|
||||||
# between zero and nonzero (or the last hit)
|
# between zero and nonzero (or the last hit)
|
||||||
count += winding
|
count += winding
|
||||||
|
inc i
|
||||||
continue
|
continue
|
||||||
if at > 0:
|
if at > 0:
|
||||||
if shouldFill(windingRule, count):
|
if shouldFill(windingRule, count):
|
||||||
|
# Look ahead to see if the next hit is in the same spot as this hit.
|
||||||
|
# If it is, see if this and the next hit's windings cancel out.
|
||||||
|
# If they do, skip the hits and do not yield yet. It will be yielded
|
||||||
|
# later in a larger chunk.
|
||||||
|
if i < numHits - 1:
|
||||||
|
let (nextAt, nextWinding) = hits[i + 1]
|
||||||
|
if nextAt == at and winding + nextWinding == 0:
|
||||||
|
i += 2
|
||||||
|
continue
|
||||||
yield (prevAt, at, count)
|
yield (prevAt, at, count)
|
||||||
prevAt = at
|
prevAt = at
|
||||||
count += winding
|
count += winding
|
||||||
|
inc i
|
||||||
|
|
||||||
when defined(pixieLeakCheck):
|
when defined(pixieLeakCheck):
|
||||||
if prevAt != width and count != 0:
|
if prevAt != width and count != 0:
|
||||||
|
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 260 KiB After Width: | Height: | Size: 260 KiB |
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 2.4 MiB After Width: | Height: | Size: 2.4 MiB |
Before Width: | Height: | Size: 280 KiB After Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 644 KiB After Width: | Height: | Size: 644 KiB |
Before Width: | Height: | Size: 783 KiB After Width: | Height: | Size: 783 KiB |
Before Width: | Height: | Size: 3.4 MiB After Width: | Height: | Size: 3.4 MiB |
Before Width: | Height: | Size: 358 KiB After Width: | Height: | Size: 357 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.4 MiB |
Before Width: | Height: | Size: 610 KiB After Width: | Height: | Size: 610 KiB |
Before Width: | Height: | Size: 519 KiB After Width: | Height: | Size: 519 KiB |
Before Width: | Height: | Size: 3.9 MiB After Width: | Height: | Size: 3.9 MiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 8 KiB After Width: | Height: | Size: 8 KiB |
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1,002 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 893 B After Width: | Height: | Size: 836 B |
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.1 KiB |