diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2016-12-09 12:34:51 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2016-12-09 15:28:04 +0000 |
commit | 210d0999a2b997566f3aeb183f50b2aa2788dbf3 (patch) | |
tree | d9c277edab61e3e5367e2c721cca07690edd0fd2 /vcl | |
parent | 5d647341feac4ef2870923bde70ddcff33a24032 (diff) |
tdf#104034 skip polygons with less than 2 points (LO 5-2)
We can get polypolgons with polygons that have 0 or 1 point only,
so we need to guard agains division-by-zero errors by skipping if
we detect such polygons (as we can't draw them anyway).
Change-Id: I08c4f4c9bb946fcbaedede4b4ae23c96e431190e
Reviewed-on: https://gerrit.libreoffice.org/31790
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/opengl/gdiimpl.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index 34a8b51d5bf3..c264c91a20b6 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -1899,6 +1899,8 @@ bool OpenGLSalGraphicsImpl::drawPolyPolygon( const basegfx::B2DPolyPolygon& rPol { for (const basegfx::B2DPolygon& rPolygon : rPolyPolygon) { + if (rPolygon.count() <= 1) + continue; basegfx::B2DPolygon aPolygon(rPolygon); if (rPolygon.areControlPointsUsed()) aPolygon = rPolygon.getDefaultAdaptiveSubdivision(); @@ -1923,6 +1925,8 @@ bool OpenGLSalGraphicsImpl::drawPolyLine( VCL_GL_INFO( "::drawPolyLine trans " << fTransparency ); if( mnLineColor == SALCOLOR_NONE ) return true; + if (rPolygon.count() <= 1) + return true; const bool bIsHairline = (rLineWidth.getX() == rLineWidth.getY()) && (rLineWidth.getX() <= 1.2); const float fLineWidth = bIsHairline ? 1.0f : rLineWidth.getX(); |