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>
This commit is contained in:
parent
fe27013495
commit
19cea16244
1 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue