summaryrefslogtreecommitdiff
path: root/vcl/source/outdev/rect.cxx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2019-11-07 14:11:35 +0000
committerAshod Nakashian <ashnakash@gmail.com>2019-12-22 22:20:30 +0100
commit24e7208306fa1c60eb0a0cee5c49b6454cad9df3 (patch)
tree38c195f7515054111222a25fba3f7a9f612796c2 /vcl/source/outdev/rect.cxx
parent9b3c7c81299590d6d845f7437f6ab16db0219929 (diff)
Drawing calc grid misses pixels on bottom and right; fix.
Don't attempt to offset empty rectangles causing serious problems. Change-Id: I6fcac11f5f5e03f7edc0662cf4e06e7f8a109f00 Reviewed-on: https://gerrit.libreoffice.org/82220 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> (cherry picked from commit fb974bc968b3a1a95f8e621776076522ec719dc6) Reviewed-on: https://gerrit.libreoffice.org/84993 Tested-by: Jenkins Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'vcl/source/outdev/rect.cxx')
-rw-r--r--vcl/source/outdev/rect.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/vcl/source/outdev/rect.cxx b/vcl/source/outdev/rect.cxx
index ecbeb12fbfee..4cced0f9b7e9 100644
--- a/vcl/source/outdev/rect.cxx
+++ b/vcl/source/outdev/rect.cxx
@@ -232,6 +232,11 @@ void OutputDevice::DrawGrid( const tools::Rectangle& rRect, const Size& rDist, D
if( mbOutputClipped )
return;
+ // FIXME: seems we have an off-by-one around the border
+ // here with the cairo / svp backend at least.
+ aDstRect.AdjustRight(1);
+ aDstRect.AdjustBottom(1);
+
const long nDistX = std::max( rDist.Width(), 1L );
const long nDistY = std::max( rDist.Height(), 1L );
long nX = ( rRect.Left() >= aDstRect.Left() ) ? rRect.Left() : ( rRect.Left() + ( ( aDstRect.Left() - rRect.Left() ) / nDistX ) * nDistX );