From bb5a9cbac96b90ee819be45f5b2f8d3cec36edff Mon Sep 17 00:00:00 2001 From: attila Date: Fri, 15 Aug 2025 17:21:39 +0200 Subject: [PATCH] Direct2D: Fix wrong brush transform calculation This change is practically a no-op, because if the affected branch is taken, then the world transform was not applied, so transform is a unity matrix. But if transform was non-unity, then the wrong ordering would cause an observable error. Logically the brush transformation is nested inside the world transformation so the right order is applying the brush transform first followed by the world transform. --- .../native/juce_Direct2DGraphicsContextImpl_windows.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/juce_graphics/native/juce_Direct2DGraphicsContextImpl_windows.cpp b/modules/juce_graphics/native/juce_Direct2DGraphicsContextImpl_windows.cpp index d86bb9064a..d1a6e20651 100644 --- a/modules/juce_graphics/native/juce_Direct2DGraphicsContextImpl_windows.cpp +++ b/modules/juce_graphics/native/juce_Direct2DGraphicsContextImpl_windows.cpp @@ -480,7 +480,7 @@ public: if (fillType.transform.isOnlyTranslation()) translation += Point (fillType.transform.getTranslationX(), fillType.transform.getTranslationY()); else - transform = transform.followedBy (fillType.transform); + transform = fillType.transform.followedBy (transform); } if ((flags & BrushTransformFlags::applyInverseWorldTransform) != 0) @@ -513,7 +513,7 @@ public: transform = currentTransform.getTransform(); if ((flags & BrushTransformFlags::applyFillTypeTransform) != 0) - transform = transform.followedBy (fillType.transform); + transform = fillType.transform.followedBy (transform); if ((flags & BrushTransformFlags::applyInverseWorldTransform) != 0) transform = transform.followedBy (currentTransform.getTransform().inverted());