vcl: utilize DeviceToWindowUnits pipeline stage in map.cxx

Updates OutputDevice::ImplDevicePixelToLogic to use the newly
established CoordinateMapper transformation pipeline when MapMode
is disabled.

Previously, this block manually subtracted GetDeviceOriginX/Y
from the given rectangle to convert absolute device pixels into
window-relative coordinates. This replaces the raw arithmetic
with explicit DeviceToWindowUnitsX/Y calls.

This change encapsulates the offset logic entirely within
CoordinateMapper and ensures the coordinate space transition
is explicitly documented by the API nomenclature.

Change-Id: Ica26ebd9b3c04eba2816dac26e2e8bca2a403776
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203659
Tested-by: Jenkins
Reviewed-by: Dan Williams <dcbw@libreoffice.org>
This commit is contained in:
Christopher Sherlock
2026-07-31 17:02:19 +02:00
committed by Dan Williams
parent d66d99a5b9
commit 105ff994be
+5 -4
View File
@@ -245,10 +245,11 @@ tools::Rectangle OutputDevice::ImplDevicePixelToLogic( const tools::Rectangle& r
if ( !mpMapper->IsMapModeEnabled() )
{
aRetval = tools::Rectangle(
rPixelRect.Left()-mpMapper->GetDeviceOriginX(),
rPixelRect.Top()-mpMapper->GetDeviceOriginY(),
rPixelRect.IsWidthEmpty() ? 0 : rPixelRect.Right()-mpMapper->GetDeviceOriginX(),
rPixelRect.IsHeightEmpty() ? 0 : rPixelRect.Bottom()-mpMapper->GetDeviceOriginY() );
mpMapper->DeviceToWindowUnitsX(rPixelRect.Left()),
mpMapper->DeviceToWindowUnitsY(rPixelRect.Top()),
rPixelRect.IsWidthEmpty() ? 0 : mpMapper->DeviceToWindowUnitsX(rPixelRect.Right()),
rPixelRect.IsHeightEmpty() ? 0 : mpMapper->DeviceToWindowUnitsY(rPixelRect.Bottom())
);
}
else
{