diff options
-rw-r--r-- | canvas/source/cairo/cairo_canvashelper.cxx | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx index def6cd6cfa29..9b64c08a991f 100644 --- a/canvas/source/cairo/cairo_canvashelper.cxx +++ b/canvas/source/cairo/cairo_canvashelper.cxx @@ -973,7 +973,27 @@ namespace cairocanvas if( nPointCount > 1) { bool bIsBezier = aPolygon.areControlPointsUsed(); - bool bIsRectangle = ::basegfx::tools::isRectangle( aPolygon ); + bool bIsRectangle = ::basegfx::tools::isRectangle(aPolygon); + if (bIsRectangle) + { + //tdf#86473, if this rectangle will end up after rounding + //to have no area, then nothing will be drawn, so remove + //such rectangles from the rounding optimization(?) effort + basegfx::B2DRange aRange = ::basegfx::tools::getRange(aPolygon); + double x1 = aRange.getMinX(); + double x2 = aRange.getMaxX(); + double y1 = aRange.getMinY(); + double y2 = aRange.getMaxY(); + cairo_matrix_transform_point(&aOrigMatrix, &x1, &y1); + cairo_matrix_transform_point(&aOrigMatrix, &x2, &y2); + basegfx::B2DRange aRoundedRange(basegfx::fround(x1), + basegfx::fround(y1), + basegfx::fround(x2), + basegfx::fround(y2)); + bIsRectangle = aRoundedRange.getWidth() != 0.0 && + aRoundedRange.getHeight() != 0.0; + } + ::basegfx::B2DPoint aA, aB, aP; for( sal_uInt32 j=0; j < nExtendedPointCount; j++ ) |