summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-11-16 17:27:15 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-11-16 20:35:46 +0100
commit7060192b6facd92cadb5bb084052903f2695d67d (patch)
tree6925749ed25bd82ef284cc01b5611007a29abe29 /svx
parentb61ca6f7bf4e5b5b1980ad03f2a5f2d01e8c22fe (diff)
tdf#149322 apparent distortion of glyphs on scrolling
sometimes there's a 1 pixel difference here vs to the amount seen in Window::Scroll. The little misplaced tails of glyphs are actually in the right place, and it is the large rectangle of copied text above those that is in the wrong place. Subtract these origins while in logic space, before turning that result back to pixels to get consistent results for equal distances. Change-Id: I37e77f38b95456cee32ff44cde2893986d52cde3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142789 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/sdr/overlay/overlaymanagerbuffered.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
index 365171757934..0e62cd73a37a 100644
--- a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
+++ b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
@@ -52,11 +52,13 @@ namespace sdr::overlay
const Point& rOriginNew = getOutputDevice().GetMapMode().GetOrigin();
const bool bScrolled(rOriginOld != rOriginNew);
+
if(bScrolled)
{
- // get pixel bounds
- const Point aOriginOldPixel(mpBufferDevice->LogicToPixel(rOriginOld));
- const Point aOriginNewPixel(mpBufferDevice->LogicToPixel(rOriginNew));
+ // get pixel bounds (tdf#149322 do subtraction in logic units before converting result back to pixel)
+ const Point aLogicOriginDiff(rOriginNew - rOriginOld);
+ const Size aPixelOriginDiff(mpBufferDevice->LogicToPixel(Size(aLogicOriginDiff.X(), aLogicOriginDiff.Y())));
+ const Point aDestinationOffsetPixel(aPixelOriginDiff.Width(), aPixelOriginDiff.Height());
const Size aOutputSizePixel(mpBufferDevice->GetOutputSizePixel());
// remember and switch off MapMode
@@ -64,7 +66,6 @@ namespace sdr::overlay
mpBufferDevice->EnableMapMode(false);
// scroll internally buffered stuff
- const Point aDestinationOffsetPixel(aOriginNewPixel - aOriginOldPixel);
mpBufferDevice->DrawOutDev(
aDestinationOffsetPixel, aOutputSizePixel, // destination
Point(), aOutputSizePixel); // source