diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2019-10-31 20:26:44 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2019-11-26 13:24:53 +0100 |
commit | 0d2e258c9e088ef4eaebceb5a6a5b218b7d15d1a (patch) | |
tree | c28d05c83e722de176c2b9010d66592ddac38276 /vcl | |
parent | 832603a7d628ca033208832a81428ec09b0466d1 (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
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/skia/gdiimpl.cxx | 4 |
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); |