From f522dbb9ff275bf18d5aa07dc840120bb0c1a263 Mon Sep 17 00:00:00 2001 From: treeform Date: Mon, 29 Nov 2021 17:30:18 -0800 Subject: [PATCH] f --- src/pixie/paths.nim | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/pixie/paths.nim b/src/pixie/paths.nim index 8515f8b..e219689 100644 --- a/src/pixie/paths.nim +++ b/src/pixie/paths.nim @@ -2206,7 +2206,7 @@ when defined(pixieSweeps): windingRule: WindingRule, blendMode: BlendMode ) = - const q = 1/256.0 + let rgbx = color.rgbx var segments = shapes.shapesToSegments() let @@ -2216,6 +2216,13 @@ when defined(pixieSweeps): if segments.len == 0 or bounds.w.int == 0 or bounds.h.int == 0: return + # const q = 1/10 + # for i in 0 ..< segments.len: + # segments[i][0].at.x = quantize(segments[i][0].at.x, q) + # segments[i][0].at.y = quantize(segments[i][0].at.y, q) + # segments[i][0].to.x = quantize(segments[i][0].to.x, q) + # segments[i][0].to.y = quantize(segments[i][0].to.y, q) + # Create sorted segments. segments.sortSegments(0, segments.high) @@ -2378,6 +2385,11 @@ when defined(pixieSweeps): currCutLine: int, sweep: seq[SweepLine] ) = + + if cutLines[currCutLine + 1] - cutLines[currCutLine] < 1/256: + # TODO some thing about micro sweeps + return + let sweepHeight = cutLines[currCutLine + 1] - cutLines[currCutLine] yFracTop = ((y.float32 - cutLines[currCutLine]) / sweepHeight).clamp(0, 1)