summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-10-31 20:26:44 +0100
committerLuboš Luňák <l.lunak@collabora.com>2019-11-27 09:55:14 +0100
commit22f88068faffd7e693ff169aa7cead05d9c1a350 (patch)
tree5954a036e45c8d474a418094d6069cba8e627065
parentcefafdf6865251e2efcbcfb8f19af6bfd72390c3 (diff)
skia: don't loop to first point if the polygon is not closed
This fixes drawing of non-closed polylines. Without this fix the non-closed polylines an extra step is still drawn from the last point in the polygon to the first one (as if the polyline would be closed). Change-Id: I0171aede3dc03f83b7dd8ae699e6b505b3fd4f7f
-rw-r--r--vcl/skia/gdiimpl.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index b375b39d1c28..a406d85e924d 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -59,6 +59,10 @@ void lclPolygonToPath(const basegfx::B2DPolygon& rPolygon, SkPath& rPath)
for (sal_uInt32 nIndex = 0; nIndex <= nPointCount; nIndex++)
{
+ if (nIndex == nPointCount && !bClosePath)
+ continue;
+
+ // Make sure we loop the last point to first point
nCurrentIndex = nIndex % nPointCount;
aCurrentPoint = rPolygon.getB2DPoint(nCurrentIndex);