From 94962eb1636f2b138ae42c4824df3abc2a908ed8 Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Sat, 14 Jan 2023 22:52:57 -0600 Subject: [PATCH 1/2] simple pure-internal fix for a test --- src/pixie/paths.nim | 9 ++++++--- tests/test_paths.nim | 14 +++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/pixie/paths.nim b/src/pixie/paths.nim index 5b34efc..69a9635 100644 --- a/src/pixie/paths.nim +++ b/src/pixie/paths.nim @@ -1056,7 +1056,10 @@ proc commandsToShapes( shape.addSegment(at, start) result.add(shape) -proc shapesToSegments(shapes: seq[Polygon]): seq[(Segment, int16)] = +proc shapesToSegments( + shapes: seq[Polygon], + skipHorizontal = true +): seq[(Segment, int16)] = ## Converts the shapes into a set of filtered segments with winding value. # Quantize the segment to prevent leaks @@ -1075,7 +1078,7 @@ proc shapesToSegments(shapes: seq[Polygon]): seq[(Segment, int16)] = segment = segment(vec1, vec2) vec1 = vec2 - if segment.at.y == segment.to.y: # Skip horizontal + if skipHorizontal and segment.at.y == segment.to.y: # Skip horizontal continue var segment = segment @@ -1119,7 +1122,7 @@ proc computeBounds*( ## Compute the bounds of the path. var shapes = path.commandsToShapes(true, pixelScale(transform)) shapes.transform(transform) - computeBounds(shapes.shapesToSegments()) + computeBounds(shapes.shapesToSegments(skipHorizontal = false)) proc initPartitionEntry(segment: Segment, winding: int16): PartitionEntry = result.segment = segment diff --git a/tests/test_paths.nim b/tests/test_paths.nim index 68cf02b..867e0b7 100644 --- a/tests/test_paths.nim +++ b/tests/test_paths.nim @@ -746,13 +746,13 @@ block: # let path = parsePath(pathStr) # doAssert path.computeBounds() == rect(0, 0, 1000, 1000) -# block: -# let pathStr = """ -# M 0 0 -# L 100 0 -# """ -# let path = parsePath(pathStr) -# doAssert path.computeBounds() == rect(0, 0, 100, 0) +block: + let pathStr = """ + M 0 0 + L 100 0 + """ + let path = parsePath(pathStr) + doAssert path.computeBounds() == rect(0, 0, 100, 0) block: let pathStr = """ From ffab4597a7b7caf72ecc9815ed48f214be8c2a8e Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Sat, 14 Jan 2023 22:56:12 -0600 Subject: [PATCH 2/2] update github actions --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1133657..373ec9c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,10 +11,11 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: jiro4989/setup-nim-action@v1 with: nim-version: ${{ matrix.nim-version }} + repo-token: ${{ secrets.GITHUB_TOKEN }} - run: nimble test --gc:arc -d:release -y - run: nimble test --gc:arc -d:release -d:pixieNoSimd -y - run: nimble test --gc:orc -d:release -y