From 9bdf69e49945193896b1c427c8bb7f20983d2668 Mon Sep 17 00:00:00 2001 From: reuk Date: Mon, 10 Feb 2025 11:27:36 +0000 Subject: [PATCH] PathStrokeType: Avoid unnecessarily starting new subpaths --- .../juce_graphics/geometry/juce_PathStrokeType.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/juce_graphics/geometry/juce_PathStrokeType.cpp b/modules/juce_graphics/geometry/juce_PathStrokeType.cpp index ebd2ac0481..15967990c6 100644 --- a/modules/juce_graphics/geometry/juce_PathStrokeType.cpp +++ b/modules/juce_graphics/geometry/juce_PathStrokeType.cpp @@ -713,10 +713,13 @@ void PathStrokeType::createDashedStroke (Path& destPath, return; } - if (isSolid && ! first) - newDestPath.lineTo (it.x1, it.y1); - else - newDestPath.startNewSubPath (it.x1, it.y1); + if (isSolid) + { + if (first) + newDestPath.startNewSubPath (it.x1, it.y1); + else + newDestPath.lineTo (it.x1, it.y1); + } dx = it.x2 - it.x1; dy = it.y2 - it.y1;