[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - vcl/opengl

Miklos Vajna vmiklos at collabora.co.uk
Wed Jul 4 12:26:23 UTC 2018


 vcl/opengl/gdiimpl.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit ab89b8af4784d9edc2dbab40f14fb47d43bfbb5f
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Jul 3 17:17:42 2018 +0200

    tdf#115671 vcl opengl: fix drawing of polylines with duplicate points
    
    The bugdoc had a custom shape, the interesting part of it was a triangle
    with miter line join, where the last segment was missing. In that case
    RenderList::addDrawPolyLine() mishandled the polyline, as it does not
    expect duplicate points in it.
    
    (cherry picked from commit d4b49841090c70cc31000fb30de9b5ddc07b0c42)
    
    Change-Id: I06d5c2d191bb6269a87da1f006f27a94205f5145
    Reviewed-on: https://gerrit.libreoffice.org/56925
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 0fd1d0788eb6..ac976bfee213 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -1601,7 +1601,12 @@ bool OpenGLSalGraphicsImpl::drawPolyLine(const basegfx::B2DPolygon& rPolygon, do
 {
     VCL_GL_INFO("::drawPolyLine " << rPolygon.getB2DRange());
 
-    mpRenderList->addDrawPolyLine(rPolygon, fTransparency, rLineWidth, eLineJoin, eLineCap,
+    // addDrawPolyLine() assumes that there are no duplicate points in the
+    // polygon.
+    basegfx::B2DPolygon aPolygon(rPolygon);
+    aPolygon.removeDoublePoints();
+
+    mpRenderList->addDrawPolyLine(aPolygon, fTransparency, rLineWidth, eLineJoin, eLineCap,
                                   fMiterMinimumAngle, mnLineColor, mrParent.getAntiAliasB2DDraw());
     PostBatchDraw();
     return true;


More information about the Libreoffice-commits mailing list