1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Direct2D: Remove SetDpi call in startFrame

Previously, plugins and standalone apps could produce slightly different
visual results, particularly anti-aliasing, when displaying on a display
with native scaling applied. The discrepancy was caused by SetDpi being
called with a larger-than-default value (e.g. 192 DPI on a 200% scaled
display) in a standalone app, whereas SetDpi would always be called with
the default value of 96 in a plugin.

Keeping the default value seems to produce better results, so standalone
apps will now retain the default DPI.
This commit is contained in:
reuk 2025-01-20 12:56:28 +00:00
parent 183c327e75
commit f12d29899c
No known key found for this signature in database
2 changed files with 4 additions and 7 deletions

View file

@ -610,7 +610,7 @@ public:
popAllSavedStates();
}
virtual SavedState* startFrame (float dpiScale)
virtual SavedState* startFrame()
{
prepare();
@ -636,9 +636,6 @@ public:
// Init device context transform
resetTransform (deviceContext);
const auto effectiveDpi = USER_DEFAULT_SCREEN_DPI * dpiScale;
deviceContext->SetDpi (effectiveDpi, effectiveDpi);
// Start drawing
deviceContext->SetTarget (getDeviceContextTarget());
deviceContext->BeginDraw();
@ -899,7 +896,7 @@ bool Direct2DGraphicsContext::startFrame (float dpiScale)
{
const auto pimpl = getPimpl();
const auto paintAreas = pimpl->getPaintAreas();
currentState = pimpl->startFrame (dpiScale);
currentState = pimpl->startFrame();
if (currentState == nullptr)
return false;