diff options
author | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2021-05-20 23:27:45 +0200 |
---|---|---|
committer | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2021-05-21 07:30:28 +0200 |
commit | fb5247bf587518eaa01cf5d54dceddf73827d740 (patch) | |
tree | c9262ed1b476a725151a8752914c3d1ec54453a1 /tools | |
parent | 6155689bb6f1d72f29b43ac5ae94b32522ef9b42 (diff) |
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.cxx | 6 |
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 ) |