diff --git a/modules/juce_graphics/native/juce_Direct2DGraphicsContext_windows.cpp b/modules/juce_graphics/native/juce_Direct2DGraphicsContext_windows.cpp index 49c6bdc5d1..785b380030 100644 --- a/modules/juce_graphics/native/juce_Direct2DGraphicsContext_windows.cpp +++ b/modules/juce_graphics/native/juce_Direct2DGraphicsContext_windows.cpp @@ -946,11 +946,6 @@ void Direct2DGraphicsContext::excludeClipRectangle (const Rectangle& userSp } } -void Direct2DGraphicsContext::setPhysicalPixelScaleFactor (float f) -{ - scale = f; -} - void Direct2DGraphicsContext::resetPendingClipList() { auto& transform = currentState->currentTransform; @@ -1403,7 +1398,12 @@ const Font& Direct2DGraphicsContext::getFont() float Direct2DGraphicsContext::getPhysicalPixelScaleFactor() const { - return scale; + if (currentState != nullptr) + return currentState->currentTransform.getPhysicalPixelScaleFactor(); + + // If this is hit, there's no frame in progress, so the scale factor isn't meaningful + jassertfalse; + return 1.0f; } void Direct2DGraphicsContext::drawRoundedRectangle (const Rectangle& area, float cornerSize, float lineThickness) diff --git a/modules/juce_graphics/native/juce_Direct2DGraphicsContext_windows.h b/modules/juce_graphics/native/juce_Direct2DGraphicsContext_windows.h index c312c0a234..ba906a00cf 100644 --- a/modules/juce_graphics/native/juce_Direct2DGraphicsContext_windows.h +++ b/modules/juce_graphics/native/juce_Direct2DGraphicsContext_windows.h @@ -113,9 +113,6 @@ public: static int constexpr minFrameSize = 1; static int constexpr maxFrameSize = 16384; - //============================================================================== - void setPhysicalPixelScaleFactor (float); - protected: struct SavedState; SavedState* currentState = nullptr; @@ -170,7 +167,6 @@ protected: }; uint64_t frame = 0; - float scale = 1.0f; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Direct2DGraphicsContext) };