summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-05-25 10:27:47 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-05-31 16:18:42 +0200
commitba3f665270006ced34292cd47eabe771a4878869 (patch)
tree08d794a516412aed69476dde69e76a957cd6fbf2
parent6a0cbf145d2f776076240e975719f4d9b2035f26 (diff)
tdf#108056 sw SubtractFlys: fix off-by-one error in clip rectangle calculation
See commit c5cf8824a619401627f18abc7b3049551c71ac2a (tdf#86578: sw: fix rendering of legacy documents with fly anchored at fly, 2015-04-10) for the context, this fixes the vertical unexpected thin white lines of the bugdoc. Change-Id: I5bb0536e84a8486440748ac9ebb24b22344cc03f Reviewed-on: https://gerrit.libreoffice.org/38015 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit e6bdcfb8e0bdd456f81d4391df355a76be13afd3)
-rw-r--r--sw/source/core/layout/paintfrm.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index ba8fdc916207..d8d6cc79340d 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -1924,7 +1924,12 @@ bool DrawFillAttributes(
tools::PolyPolygon tempRegion;
for (size_t i = 0; i < rPaintRegion.size(); ++i)
{
- tempRegion.Insert( tools::Polygon(rPaintRegion[i].SVRect()));
+ // Don't use SwRect::SvRect() here, as the clip
+ // rectangle is supposed to cover everything outside
+ // the flys, so the Width() - 1 isn't correct.
+ const SwRect& rRect = rPaintRegion[i];
+ tools::Rectangle aRectangle(rRect.Pos().getX(), rRect.Pos().getY(), rRect.Pos().getX() + rRect.SSize().getWidth(), rRect.Pos().getY() + rRect.SSize().getHeight());
+ tempRegion.Insert(tools::Polygon(aRectangle));
}
basegfx::B2DPolyPolygon const maskRegion( tempRegion.getB2DPolyPolygon());