This commit is contained in:
treeform 2021-11-29 17:30:18 -08:00
parent 367a86b566
commit f522dbb9ff

View file

@ -2206,7 +2206,7 @@ when defined(pixieSweeps):
windingRule: WindingRule, windingRule: WindingRule,
blendMode: BlendMode blendMode: BlendMode
) = ) =
const q = 1/256.0
let rgbx = color.rgbx let rgbx = color.rgbx
var segments = shapes.shapesToSegments() var segments = shapes.shapesToSegments()
let let
@ -2216,6 +2216,13 @@ when defined(pixieSweeps):
if segments.len == 0 or bounds.w.int == 0 or bounds.h.int == 0: if segments.len == 0 or bounds.w.int == 0 or bounds.h.int == 0:
return 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. # Create sorted segments.
segments.sortSegments(0, segments.high) segments.sortSegments(0, segments.high)
@ -2378,6 +2385,11 @@ when defined(pixieSweeps):
currCutLine: int, currCutLine: int,
sweep: seq[SweepLine] sweep: seq[SweepLine]
) = ) =
if cutLines[currCutLine + 1] - cutLines[currCutLine] < 1/256:
# TODO some thing about micro sweeps
return
let let
sweepHeight = cutLines[currCutLine + 1] - cutLines[currCutLine] sweepHeight = cutLines[currCutLine + 1] - cutLines[currCutLine]
yFracTop = ((y.float32 - cutLines[currCutLine]) / sweepHeight).clamp(0, 1) yFracTop = ((y.float32 - cutLines[currCutLine]) / sweepHeight).clamp(0, 1)