Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified examples/gradient.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/heart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/masking.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/shadow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/text_spans.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/tiger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 15 additions & 13 deletions src/pixie/paths.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1192,26 +1192,28 @@ proc computeCoverages(

# Do scanlines for this row
let partitionIndex = partitioning.getIndexForY(y)
var
yLine = y.float32 + initialOffset - offset
scanline = line(vec2(0, yLine), vec2(width, yLine))
var yLine = y.float32 + initialOffset - offset
for m in 0 ..< quality:
yLine += offset
scanline.a.y = yLine
scanline.b.y = yLine
numHits = 0
for i in 0 ..< partitioning.partitions[partitionIndex].len: # Perf
let
segment = partitioning.partitions[partitionIndex][i][0]
winding = partitioning.partitions[partitionIndex][i][1]
if segment.at.y <= scanline.a.y and segment.to.y >= scanline.a.y:
var at: Vec2
if scanline.intersects(segment, at):
if segment.to != at:
if numHits == hits.len:
hits.setLen(hits.len * 2)
hits[numHits] = (min(at.x, width), winding)
inc numHits
if segment.at.y <= yLine and segment.to.y >= yLine:
let x =
if segment.at.x - segment.to.x == 0:
segment.at.x
else:
let
m = (segment.at.y - segment.to.y) / (segment.at.x - segment.to.x)
b = segment.at.y - m * segment.at.x
(yLine - b) / m

if numHits == hits.len:
hits.setLen(hits.len * 2)
hits[numHits] = (min(x, width), winding)
inc numHits

sort(hits, 0, numHits - 1)

Expand Down
Binary file modified tests/contexts/bezierCurveTo_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/contexts/clip_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/contexts/clip_1b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/contexts/clip_1d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/contexts/clip_1f.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/contexts/clip_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/contexts/ellipse_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/contexts/quadracticCurveTo_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/contexts/quadracticCurveTo_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/contexts/strokeText_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/fileformats/svg/diffs/Ghostscript_Tiger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/fileformats/svg/diffs/circle01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/fileformats/svg/diffs/ellipse01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/fileformats/svg/diffs/miterlimit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/fileformats/svg/diffs/polygon01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/fileformats/svg/diffs/quad01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/fileformats/svg/diffs/rect02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/fileformats/svg/diffs/scale.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/fileformats/svg/emojitwo.png
Binary file modified tests/fileformats/svg/flat-color-icons.png
Binary file modified tests/fileformats/svg/ionicons.png
Binary file modified tests/fileformats/svg/noto-emoji.png
Binary file modified tests/fileformats/svg/openmoji.png
Binary file modified tests/fileformats/svg/rendered/Ghostscript_Tiger.png
Binary file modified tests/fileformats/svg/rendered/circle01.png
Binary file modified tests/fileformats/svg/rendered/ellipse01.png
Binary file modified tests/fileformats/svg/rendered/miterlimit.png
Binary file modified tests/fileformats/svg/rendered/polygon01.png
Binary file modified tests/fileformats/svg/rendered/quad01.png
Binary file modified tests/fileformats/svg/rendered/rect02.png
Binary file modified tests/fileformats/svg/rendered/scale.png
Binary file modified tests/fileformats/svg/simple-icons.png
Binary file modified tests/fileformats/svg/tabler-icons.png
Binary file modified tests/fileformats/svg/twbs-icons.png
Binary file modified tests/fileformats/svg/twemoji.png
Binary file modified tests/fonts/diffs/alignments.png
Binary file modified tests/fonts/diffs/basic10.png
Binary file modified tests/fonts/diffs/basic6.png
Binary file modified tests/fonts/diffs/basic8b.png
Binary file modified tests/fonts/diffs/cff.png
Binary file modified tests/fonts/diffs/cff_jp.png
Binary file modified tests/fonts/diffs/cff_strikethrough.png
Binary file modified tests/fonts/diffs/cff_underline.png
Binary file modified tests/fonts/diffs/fallback.png
Binary file modified tests/fonts/diffs/fallback2.png
Binary file modified tests/fonts/diffs/huge1.png
Binary file modified tests/fonts/diffs/huge1_nokern.png
Binary file modified tests/fonts/diffs/huge2.png
Binary file modified tests/fonts/diffs/huge2_nokern.png
Binary file modified tests/fonts/diffs/huge3.png
Binary file modified tests/fonts/diffs/huge3_nokern.png
Binary file modified tests/fonts/diffs/image_stroke.png
Binary file modified tests/fonts/diffs/lines2.png
Binary file modified tests/fonts/diffs/mask_stroke.png
Binary file modified tests/fonts/diffs/pairs1.png
Binary file modified tests/fonts/diffs/pairs2.png
Binary file modified tests/fonts/diffs/pairs3.png
Binary file modified tests/fonts/diffs/paragraph1.png
Binary file modified tests/fonts/diffs/paragraph1_2.png
Binary file modified tests/fonts/diffs/paragraph1_3.png
Binary file modified tests/fonts/diffs/paragraph1_nokern.png
Binary file modified tests/fonts/diffs/paragraph1_nokern_2.png
Binary file modified tests/fonts/diffs/paragraph1_nokern_3.png
Binary file modified tests/fonts/diffs/paragraph2.png
Binary file modified tests/fonts/diffs/paragraph2_2.png
Binary file modified tests/fonts/diffs/paragraph2_3.png
Binary file modified tests/fonts/diffs/paragraph2_nokern.png
Binary file modified tests/fonts/diffs/paragraph2_nokern_2.png
Binary file modified tests/fonts/diffs/paragraph2_nokern_3.png
Binary file modified tests/fonts/diffs/paragraph3.png
Binary file modified tests/fonts/diffs/paragraph3_2.png
Binary file modified tests/fonts/diffs/paragraph3_3.png
Binary file modified tests/fonts/diffs/paragraph3_nokern.png
Binary file modified tests/fonts/diffs/paragraph3_nokern_2.png
Binary file modified tests/fonts/diffs/paragraph3_nokern_3.png
Binary file modified tests/fonts/diffs/paragraph4.png
Binary file modified tests/fonts/diffs/paragraph4_2.png
Binary file modified tests/fonts/diffs/paragraph4_3.png
Binary file modified tests/fonts/diffs/paragraph4_nokern.png
Binary file modified tests/fonts/diffs/paragraph4_nokern_2.png
Binary file modified tests/fonts/diffs/paragraph4_nokern_3.png
Binary file modified tests/fonts/diffs/paragraph5.png
Binary file modified tests/fonts/diffs/paragraph5_2.png
Binary file modified tests/fonts/diffs/paragraph5_3.png
Binary file modified tests/fonts/diffs/paragraph5_nokern.png
Binary file modified tests/fonts/diffs/paragraph5_nokern_2.png
Binary file modified tests/fonts/diffs/paragraph5_nokern_3.png
Binary file modified tests/fonts/diffs/selection_rects2.png
Binary file modified tests/fonts/diffs/spans1.png
Binary file modified tests/fonts/diffs/spans2.png
Binary file modified tests/fonts/diffs/spans4.png
Binary file modified tests/fonts/diffs/spans5.png
Binary file modified tests/fonts/diffs/spans6.png
Binary file modified tests/fonts/diffs/strikethrough3.png
Binary file modified tests/fonts/diffs/underline3.png
Binary file modified tests/fonts/rendered/alignments.png
Binary file modified tests/fonts/rendered/basic10.png
Binary file modified tests/fonts/rendered/basic6.png
Binary file modified tests/fonts/rendered/basic8b.png
Binary file modified tests/fonts/rendered/cff.png
Binary file modified tests/fonts/rendered/cff_jp.png
Binary file modified tests/fonts/rendered/cff_strikethrough.png
Binary file modified tests/fonts/rendered/cff_underline.png
Binary file modified tests/fonts/rendered/fallback.png
Binary file modified tests/fonts/rendered/fallback2.png
Binary file modified tests/fonts/rendered/huge1.png
Binary file modified tests/fonts/rendered/huge1_nokern.png
Binary file modified tests/fonts/rendered/huge2.png
Binary file modified tests/fonts/rendered/huge2_nokern.png
Binary file modified tests/fonts/rendered/huge3.png
Binary file modified tests/fonts/rendered/huge3_nokern.png
Binary file modified tests/fonts/rendered/image_stroke.png
Binary file modified tests/fonts/rendered/lines2.png
Binary file modified tests/fonts/rendered/mask_stroke.png
Binary file modified tests/fonts/rendered/pairs1.png
Binary file modified tests/fonts/rendered/pairs2.png
Binary file modified tests/fonts/rendered/pairs3.png
Binary file modified tests/fonts/rendered/paragraph1.png
Binary file modified tests/fonts/rendered/paragraph1_2.png
Binary file modified tests/fonts/rendered/paragraph1_3.png
Binary file modified tests/fonts/rendered/paragraph1_nokern.png
Binary file modified tests/fonts/rendered/paragraph1_nokern_2.png
Binary file modified tests/fonts/rendered/paragraph1_nokern_3.png
Binary file modified tests/fonts/rendered/paragraph2.png
Binary file modified tests/fonts/rendered/paragraph2_2.png
Binary file modified tests/fonts/rendered/paragraph2_3.png
Binary file modified tests/fonts/rendered/paragraph2_nokern.png
Binary file modified tests/fonts/rendered/paragraph2_nokern_2.png
Binary file modified tests/fonts/rendered/paragraph2_nokern_3.png
Binary file modified tests/fonts/rendered/paragraph3.png
Binary file modified tests/fonts/rendered/paragraph3_2.png
Binary file modified tests/fonts/rendered/paragraph3_3.png
Binary file modified tests/fonts/rendered/paragraph3_nokern.png
Binary file modified tests/fonts/rendered/paragraph3_nokern_2.png
Binary file modified tests/fonts/rendered/paragraph3_nokern_3.png
Binary file modified tests/fonts/rendered/paragraph4.png
Binary file modified tests/fonts/rendered/paragraph4_2.png
Binary file modified tests/fonts/rendered/paragraph4_3.png
Binary file modified tests/fonts/rendered/paragraph4_nokern.png
Binary file modified tests/fonts/rendered/paragraph4_nokern_2.png
Binary file modified tests/fonts/rendered/paragraph4_nokern_3.png
Binary file modified tests/fonts/rendered/paragraph5.png
Binary file modified tests/fonts/rendered/paragraph5_2.png
Binary file modified tests/fonts/rendered/paragraph5_3.png
Binary file modified tests/fonts/rendered/paragraph5_nokern.png
Binary file modified tests/fonts/rendered/paragraph5_nokern_2.png
Binary file modified tests/fonts/rendered/paragraph5_nokern_3.png
Binary file modified tests/fonts/rendered/selection_rects1.png
Binary file modified tests/fonts/rendered/selection_rects2.png
Binary file modified tests/fonts/rendered/spans1.png
Binary file modified tests/fonts/rendered/spans2.png
Binary file modified tests/fonts/rendered/spans4.png
Binary file modified tests/fonts/rendered/spans5.png
Binary file modified tests/fonts/rendered/spans6.png
Binary file modified tests/fonts/rendered/strikethrough3.png
Binary file modified tests/fonts/rendered/underline3.png
Binary file modified tests/fonts/svg_ibm.png
Binary file modified tests/images/strokeEllipse.png
Binary file modified tests/images/strokePolygon.png
Binary file modified tests/images/strokeRoundedRect.png
Binary file modified tests/masks/drawEllipse.png
Binary file modified tests/masks/strokeEllipse.png
Binary file modified tests/masks/strokePolygon.png
Binary file modified tests/masks/strokeRoundedRect.png
Binary file modified tests/paths/arc.png
Binary file modified tests/paths/arcTo1.png
Binary file modified tests/paths/arcTo2.png
Binary file modified tests/paths/arcTo3.png
Binary file modified tests/paths/opacityStroke.png
Binary file modified tests/paths/pixelScale.png