Kaydet (Commit) 512afb41 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: tdf#105998 distort hairline borders to fall inside the canvas

if we are a hairline along the very right/bottom edge
of the canvas then distory the polygon inwards one pixel right/bottom so that
the hairline falls inside the paintable area and becomes visible

Change-Id: Ie5713f6916cf5b47fdf14f86f034e38cda9900fd
Reviewed-on: https://gerrit.libreoffice.org/34243Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst e1f36edd
...@@ -165,6 +165,27 @@ namespace drawinglayer ...@@ -165,6 +165,27 @@ namespace drawinglayer
return true; return true;
} }
//Resolves: tdf#105998 if we are a hairline along the very right/bottom edge
//of the canvas then distory the polygon inwards one pixel right/bottom so that
//the hairline falls inside the paintable area and becomes visible
Size aSize = mpOutputDevice->GetOutputSize();
basegfx::B2DRange aRange = aLocalPolygon.getB2DRange();
basegfx::B2DRange aOutputRange = aRange;
aOutputRange.transform(maCurrentTransformation);
if (std::round(aOutputRange.getMaxX()) == aSize.Width() || std::round(aOutputRange.getMaxY()) == aSize.Height())
{
basegfx::B2DRange aOnePixel(0, 0, 1, 1);
aOnePixel.transform(maCurrentTransformation);
double fXOnePixel = 1.0 / aOnePixel.getMaxX();
double fYOnePixel = 1.0 / aOnePixel.getMaxY();
basegfx::B2DPoint aTopLeft(aRange.getMinX(), aRange.getMinY());
basegfx::B2DPoint aTopRight(aRange.getMaxX() - fXOnePixel, aRange.getMinY());
basegfx::B2DPoint aBottomLeft(aRange.getMinX(), aRange.getMaxY() - fYOnePixel);
basegfx::B2DPoint aBottomRight(aRange.getMaxX() - fXOnePixel, aRange.getMaxY() - fYOnePixel);
aLocalPolygon = basegfx::tools::distort(aLocalPolygon, aRange, aTopLeft, aTopRight, aBottomLeft, aBottomRight);
}
const basegfx::BColor aLineColor(maBColorModifierStack.getModifiedColor(rSource.getBColor())); const basegfx::BColor aLineColor(maBColorModifierStack.getModifiedColor(rSource.getBColor()));
mpOutputDevice->SetFillColor(); mpOutputDevice->SetFillColor();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment