summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBartosz Kosiorek <gang65@poczta.onet.pl>2021-05-20 23:27:45 +0200
committerBartosz Kosiorek <gang65@poczta.onet.pl>2021-05-21 07:30:28 +0200
commitfb5247bf587518eaa01cf5d54dceddf73827d740 (patch)
treec9262ed1b476a725151a8752914c3d1ec54453a1 /tools
parent6155689bb6f1d72f29b43ac5ae94b32522ef9b42 (diff)
tdf#55007 tdf#142263 tdf#142268 EMF ARC, PIE, CHORD allow to draw circle
In Metafile specification, if Start Point is the same as End Point, then the full circle should be drawn. Unfortunately with previous implementation, if Start Point is the same as End Point, nothing is drawn. This patch fixes that and removed EDGES optimizations, which causes display issues. Change-Id: I16a1b98f10378d57bed59696db6cc9f228044292 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115891 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'tools')
-rw-r--r--tools/source/generic/poly.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index 88a534660894..210764086743 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -269,12 +269,12 @@ ImplPolygon::ImplPolygon( const tools::Rectangle& rBound, const Point& rStart, c
double fStep;
sal_uInt16 nStart;
sal_uInt16 nEnd;
-
- if( fDiff < 0. )
+ // #i73608# If startPoint is equal to endPoint, then draw full circle instead of nothing (as Metafiles spec)
+ if( fDiff <= 0. )
fDiff += F_2PI;
// Proportionally shrink number of points( fDiff / (2PI) );
- nPoints = std::max( static_cast<sal_uInt16>( ( fDiff * 0.1591549 ) * nPoints ), sal_uInt16(16) );
+ nPoints = std::max( static_cast<sal_uInt16>( ( fDiff / F_2PI ) * nPoints ), sal_uInt16(16) );
fStep = fDiff / ( nPoints - 1 );
if( PolyStyle::Pie == eStyle )