From 9b36effbf48638ed9f8b6dca2cf3f9c17deeabb7 Mon Sep 17 00:00:00 2001 From: reuk Date: Tue, 1 Oct 2024 14:42:21 +0100 Subject: [PATCH] Direct2D: Make checkPaintReady check more robust This additionally ensures that we'll paint when the swap chain has just been resized --- .../juce_graphics/native/juce_Direct2DHwndContext_windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/juce_graphics/native/juce_Direct2DHwndContext_windows.cpp b/modules/juce_graphics/native/juce_Direct2DHwndContext_windows.cpp index 0edfa594e0..b7d984f463 100644 --- a/modules/juce_graphics/native/juce_Direct2DHwndContext_windows.cpp +++ b/modules/juce_graphics/native/juce_Direct2DHwndContext_windows.cpp @@ -401,7 +401,7 @@ private: bool ready = Pimpl::checkPaintReady(); ready &= swap.canPaint(); ready &= compositionTree.has_value(); - ready &= deferredRepaints.getNumRectangles() > 0 || resizing; + ready &= ! getPaintAreas().isEmpty(); ready &= presentation.getPresentation() != nullptr; return ready; }