summaryrefslogtreecommitdiff
path: root/emfio/source
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 /emfio/source
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 'emfio/source')
-rw-r--r--emfio/source/reader/emfreader.cxx19
1 files changed, 2 insertions, 17 deletions
diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx
index de5e1b9f0e08..e9a3afec3f19 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -1339,7 +1339,6 @@ namespace emfio
tools::Long dh = (ny32 - nY32) / 2;
Point aCenter( nX32 + dw, nY32 + dh );
tools::Polygon aPoly( aCenter, dw, dh );
- aPoly.Optimize( PolyOptimizeFlags::EDGES );
DrawPolygon( aPoly, mbRecordPath );
}
break;
@@ -1362,7 +1361,6 @@ namespace emfio
{
mpInputStream->ReadInt32( nX32 ).ReadInt32( nY32 ).ReadInt32( nx32 ).ReadInt32( ny32 ).ReadUInt32( nW ).ReadUInt32( nH );
tools::Polygon aRoundRectPoly( ReadRectangle( nX32, nY32, nx32, ny32 ), nW, nH );
- aRoundRectPoly.Optimize( PolyOptimizeFlags::EDGES );
DrawPolygon( aRoundRectPoly, mbRecordPath );
}
break;
@@ -1373,8 +1371,8 @@ namespace emfio
{
sal_uInt32 nStartX, nStartY, nEndX, nEndY;
mpInputStream->ReadInt32( nX32 ).ReadInt32( nY32 ).ReadInt32( nx32 ).ReadInt32( ny32 ).ReadUInt32( nStartX ).ReadUInt32( nStartY ).ReadUInt32( nEndX ).ReadUInt32( nEndY );
+ SAL_INFO( "emfio", "\t\t Bounds: " << nX32 << ":" << nY32 << ", " << nx32 << ":" << ny32 << ", Start: " << nStartX << ":" << nStartY << ", End: " << nEndX << ":" << nEndY );
tools::Polygon aPoly( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ), PolyStyle::Arc );
- aPoly.Optimize( PolyOptimizeFlags::EDGES );
if ( nRecType == EMR_CHORD )
DrawPolygon( aPoly, mbRecordPath );
else
@@ -1386,20 +1384,7 @@ namespace emfio
{
sal_uInt32 nStartX, nStartY, nEndX, nEndY;
mpInputStream->ReadInt32( nX32 ).ReadInt32( nY32 ).ReadInt32( nx32 ).ReadInt32( ny32 ).ReadUInt32( nStartX ).ReadUInt32( nStartY ).ReadUInt32( nEndX ).ReadUInt32( nEndY );
- tools::Polygon aPoly;
-
- // #i73608# OutputDevice deviates from WMF
- // semantics. start==end means full ellipse here.
- if( nStartX == nEndX && nStartY == nEndY )
- {
- tools::Long dw = (nx32 - nX32) / 2;
- tools::Long dh = (ny32 - nY32) / 2;
- Point aCenter( nX32 + dw, nY32 + dh );
- aPoly = tools::Polygon( aCenter, dw, dh );
- }
- else
- aPoly = tools::Polygon( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ), PolyStyle::Pie );
- aPoly.Optimize( PolyOptimizeFlags::EDGES );
+ tools::Polygon aPoly( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ), PolyStyle::Pie );
DrawPolygon( aPoly, mbRecordPath );
}
break;