From 19cea16244956382f7e985c934c008392e13552f Mon Sep 17 00:00:00 2001 From: "Armin Le Grand (Collabora)" Date: Mon, 19 Aug 2024 17:38:52 +0200 Subject: [PATCH] CairoSDPR: Make PixelSnap better aligned Change-Id: I64ca3e6bd0690ea14e95f3ed0969c320a45f30d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172043 Tested-by: Jenkins Reviewed-by: Armin Le Grand --- drawinglayer/source/processor2d/cairopixelprocessor2d.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx index 3f2df4822b23..5fbc9dfc2749 100644 --- a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx @@ -329,12 +329,12 @@ void checkAndDoPixelSnap(cairo_t* pRT, // transform to discrete pixels cairo_user_to_device(pRT, pX, pY); - // round them, also subtract 0.5 which will be as transform in + // round them, also add 0.5 which will be as transform in // the paint method to move to 'inside' pixels when AA used. // remember: this is only done when AA is active (see bPixelSnap - // above) - *pX = basegfx::fround(*pX) - 0.5; - *pY = basegfx::fround(*pY) - 0.5; + // above) and moves the hairline to full-pixel position + *pX = trunc(*pX) + 0.5; + *pY = trunc(*pY) + 0.5; // transform back to former transformed state cairo_device_to_user(pRT, pX, pY);