From 105ff994be52f0f19db4d699198d2370a62ef0d3 Mon Sep 17 00:00:00 2001 From: Christopher Sherlock Date: Mon, 13 Apr 2026 04:27:19 +1000 Subject: [PATCH] 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 --- vcl/source/outdev/map.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx index 75ca0c608459..3b78caee9794 100644 --- a/vcl/source/outdev/map.cxx +++ b/vcl/source/outdev/map.cxx @@ -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 {