diff options
author | Armin Le Grand (Collabora) <Armin.Le.Grand@me.com> | 2024-08-19 17:38:52 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2024-08-19 19:51:52 +0200 |
commit | 19cea16244956382f7e985c934c008392e13552f (patch) | |
tree | bc457ce45664f6aff1711c6111872353cbf0afeb /drawinglayer | |
parent | fe27013495d58beedf982414bbd00f6ea577ff81 (diff) |
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 <Armin.Le.Grand@me.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/processor2d/cairopixelprocessor2d.cxx | 8 |
1 files 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); |