From 2b000ca9ca961834569296b916a834bc1341bbd3 Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Wed, 24 Feb 2021 22:22:28 -0600 Subject: [PATCH] add missing pixelScale --- src/pixie/paths.nim | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pixie/paths.nim b/src/pixie/paths.nim index 896fe87..f1a38cf 100644 --- a/src/pixie/paths.nim +++ b/src/pixie/paths.nim @@ -1404,7 +1404,11 @@ proc fillPath*( transform: Vec2 | Mat3, windingRule = wrNonZero ) = - var shapes = parseSomePath(path) + when type(transform) is Mat3: + let pixelScale = transform.maxScale() + else: + let pixelScale = 1.0 + var shapes = parseSomePath(path, pixelScale) for shape in shapes.mitems: for segment in shape.mitems: when type(transform) is Vec2: @@ -1472,8 +1476,12 @@ proc strokePath*( lineCap = lcButt, lineJoin = ljMiter ) = + when type(transform) is Mat3: + let pixelScale = transform.maxScale() + else: + let pixelScale = 1.0 var strokeShapes = strokeShapes( - parseSomePath(path), strokeWidth, lineCap, lineJoin + parseSomePath(path, pixelScale), strokeWidth, lineCap, lineJoin ) for shape in strokeShapes.mitems: for segment in shape.mitems: