summaryrefslogtreecommitdiff
path: root/emfio/source
diff options
context:
space:
mode:
authorBartosz Kosiorek <gang65@poczta.onet.pl>2021-05-04 13:37:40 +0200
committerBartosz Kosiorek <gang65@poczta.onet.pl>2021-05-06 12:12:40 +0200
commit761fdaf26dc9ed7cd0d25a7630576e7800813e2f (patch)
tree61d4705419ce42b068e5e132917f2ebef026282d /emfio/source
parent5f10242591d88f6627d7cd82172551879168f9be (diff)
tdf#142004 tdf#141982 EMF Import: Add rotation and path support for EMR_ELLIPSE
Previous implementation of EMR_ELLIPSE, doesn't support rotation and EMR_ELLIPSE was not work with EMR_BEGINPATH, EMR_ENDPATH and EMR_ABORTPATH The EMR_BEGINPATH opens path bracket construction. Once path bracket construction is open, an application can begin specifying records to define the points that lie in the path. Path bracket construction MUST be closed by an EMR_ABORTPATH or EMR_ENDPATH record. With this patch all these issue was resolved for EMR_ELLIPSE Change-Id: I6d352e0ff0326dd788d43272bf1330fa6c777df4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115101 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'emfio/source')
-rw-r--r--emfio/source/reader/emfreader.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx
index 2296855c7603..3f1945bf35a5 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -1334,7 +1334,13 @@ namespace emfio
case EMR_ELLIPSE :
{
mpInputStream->ReadInt32( nX32 ).ReadInt32( nY32 ).ReadInt32( nx32 ).ReadInt32( ny32 );
- DrawEllipse( ReadRectangle( nX32, nY32, nx32, ny32 ) );
+ SAL_INFO("emfio", "\t\t Rectangle, left: " << nX32 << ", top: " << nY32 << ", right: " << nx32 << ", bottom: " << ny32);
+ tools::Long dw = (nx32 - nX32) / 2;
+ 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;