From 3f898f6fee85e179e8940e3ccb16dc6b8d5a4301 Mon Sep 17 00:00:00 2001 From: attila Date: Tue, 15 Jul 2025 17:53:25 +0200 Subject: [PATCH] Direct2D: Fix jitter when drawing bitmaps with non-unity scaling Reverts ca3abbb96d637085a6c367b0efc4dc6c0091c1de. Prior to this fix gradually changing the Component scale would lead to the jittery movement of drawn bitmaps, as their position would be snapped to an arbitrary integral representation. --- .../native/juce_Direct2DGraphicsContext_windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/juce_graphics/native/juce_Direct2DGraphicsContext_windows.cpp b/modules/juce_graphics/native/juce_Direct2DGraphicsContext_windows.cpp index 534c1ab239..05d6b346ec 100644 --- a/modules/juce_graphics/native/juce_Direct2DGraphicsContext_windows.cpp +++ b/modules/juce_graphics/native/juce_Direct2DGraphicsContext_windows.cpp @@ -924,7 +924,7 @@ void Direct2DGraphicsContext::drawImage (const Image& imageIn, const AffineTrans continue; const auto src = intersection - pageBounds.getPosition().toFloat(); - const auto dst = getRect (intersection - pagesAndArea.area.getPosition().toFloat()).toNearestInt().toFloat(); + const auto dst = getRect (intersection - pagesAndArea.area.getPosition().toFloat()); const auto [srcConverted, dstConverted] = std::tuple (D2DUtilities::toRECT_F (src), D2DUtilities::toRECT_F (dst));