From fc29df83b5e222de5e175a7571a39bc30320a393 Mon Sep 17 00:00:00 2001 From: Anthony Nicholls Date: Tue, 18 Nov 2025 17:27:53 +0100 Subject: [PATCH] Direct2D: Fix an issue with excludeClipRectangle Without this fix many of the component tests that appear in the following commit will fail for the Direct2D renderer only. --- .../juce_Direct2DGraphicsContext_windows.cpp | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/modules/juce_graphics/native/juce_Direct2DGraphicsContext_windows.cpp b/modules/juce_graphics/native/juce_Direct2DGraphicsContext_windows.cpp index 363c99f01c..f1f057a397 100644 --- a/modules/juce_graphics/native/juce_Direct2DGraphicsContext_windows.cpp +++ b/modules/juce_graphics/native/juce_Direct2DGraphicsContext_windows.cpp @@ -432,24 +432,22 @@ void Direct2DGraphicsContext::excludeClipRectangle (const Rectangle& userSp if (transform.isOnlyTranslated) { // Just a translation; pre-translate the exclusion area - auto translatedR = transform.translated (userSpaceExcludedRectangle.toFloat()).getLargestIntegerWithin().toFloat(); + const auto translatedR = transform.translated (userSpaceExcludedRectangle.toFloat()) + .getLargestIntegerWithin() + .toFloat(); - if (! translatedR.contains (frameSize)) - { - deviceSpaceClipList.subtract (translatedR); - pendingClipList.subtract (translatedR); - } + deviceSpaceClipList.subtract (translatedR); + pendingClipList.subtract (translatedR); } else if (currentState->isCurrentTransformAxisAligned()) { // Just a scale + translation; pre-transform the exclusion area - auto transformedR = transform.boundsAfterTransform (userSpaceExcludedRectangle.toFloat()).getLargestIntegerWithin().toFloat(); + const auto transformedR = transform.boundsAfterTransform (userSpaceExcludedRectangle.toFloat()) + .getLargestIntegerWithin() + .toFloat(); - if (! transformedR.contains (frameSize)) - { - deviceSpaceClipList.subtract (transformedR); - pendingClipList.subtract (transformedR); - } + deviceSpaceClipList.subtract (transformedR); + pendingClipList.subtract (transformedR); } else {