Merge pull request #52 from guzba/master

fix tiger lip issue
This commit is contained in:
treeform 2021-01-17 22:57:40 -08:00 committed by GitHub
commit cf4e2d5b38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -503,6 +503,9 @@ proc commandsToPolygons*(commands: seq[PathCommand]): seq[seq[Vec2]] =
of RSCubic: of RSCubic:
assert command.numbers.len == 4 assert command.numbers.len == 4
if prevCommand in {Cubic, SCubic, RCubic, RSCubic}:
ctr = 2 * at - ctr2
else:
ctr = at ctr = at
ctr2.x = at.x + command.numbers[0] ctr2.x = at.x + command.numbers[0]
ctr2.y = at.y + command.numbers[1] ctr2.y = at.y + command.numbers[1]
@ -648,6 +651,8 @@ proc fillPolygons*(
if bounds.y > y.float32 or bounds.y + bounds.h < y.float32: if bounds.y > y.float32 or bounds.y + bounds.h < y.float32:
continue continue
for line in poly.segments: for line in poly.segments:
if line.at.y == line.to.y: # Skip horizontal lines
continue
var line2 = line var line2 = line
if line2.at.y > line2.to.y: # Sort order doesn't actually matter if line2.at.y > line2.to.y: # Sort order doesn't actually matter
swap(line2.at, line2.to) swap(line2.at, line2.to)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 KiB

After

Width:  |  Height:  |  Size: 347 KiB