diff options
author | Armin Le Grand <Armin.Le.Grand@me.com> | 2020-03-05 19:24:30 +0100 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2020-03-06 10:10:55 +0100 |
commit | dd117712bd5692f7bf3870ba91572a0bab54ab86 (patch) | |
tree | bde473f22e43cc320e3960c331de7051d01ad77e /vcl/opengl | |
parent | a3c8951da607d63ac7ffc76a062bb76208ca5ff3 (diff) |
tdf#124848 partial refactor hairline logic
With the handover of transformations to line
draw calls it is no longer feasible to detect
and prepare LineWidth stuff when the old
office definition for hairlnes is used, a
line width of zero. It was managed in the
system-independent part, but now may have to
be prepared in logic and not discrete (pixel)
coordinates. To do so, find and cleanup all
places where 1/1.0 was used as hairline line
width. Adapt all seven graphic subsystems to
handle the line width == 0/0.0 cases
accordingly. Test as good as possible.
Change-Id: I2badc045474dcd51612e50597b8406a55d9dc863
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90057
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'vcl/opengl')
-rw-r--r-- | vcl/opengl/gdiimpl.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index 4a4a19c89600..25cac157a56b 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -1678,7 +1678,12 @@ bool OpenGLSalGraphicsImpl::drawPolyLine( // Transform to DeviceCoordinates, get DeviceLineWidth, execute PixelSnapHairline aPolyPolygonLine.transform(rObjectToDevice); if(bPixelSnapHairline) { aPolyPolygonLine = basegfx::utils::snapPointsOfHorizontalOrVerticalEdges(aPolyPolygonLine); } - const basegfx::B2DVector aLineWidth(rObjectToDevice * rLineWidth); + + // tdf#124848 get correct LineWidth in discrete coordinates, + // take hairline case into account + const basegfx::B2DVector aLineWidth(rLineWidth.equalZero() + ? basegfx::B2DVector(1.0, 1.0) + : rObjectToDevice * rLineWidth); for(sal_uInt32 a(0); a < aPolyPolygonLine.count(); a++) { |