Kaydet (Commit) 454cd820 authored tarafından Lennard's avatar Lennard Kaydeden (comit) Petr Mladek

fix position correction for flipped shapes

This complements change a9fc1456
The Translation-compensation of that fix didn't work for flipped shapes.
Also, vertically flipped shapes made problems.
Also 360 °C = 0°C (drawingml.hxx)
I didn't dare to fix it earlier because there is some problem with the selection frames.
But that is an import bug, not caused by some export stuff!
This import bug makes the manipulation rectangles around the shapes flipped & turning in the wrong direction, perhaps due to
CroftCro$oft clockwisification!

Change-Id: I05aa036d31cd5d9a8b194897b3d92ec12d6d2c61
Signed-off-by: 's avatarLennard <Wasserthal@nefkom.net>
Reviewed-on: https://gerrit.libreoffice.org/1250Reviewed-by: 's avatarPetr Mladek <pmladek@suse.cz>
Tested-by: 's avatarPetr Mladek <pmladek@suse.cz>
üst e8e263de
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <tools/poly.hxx> #include <tools/poly.hxx>
#include <filter/msfilter/escherex.hxx> #include <filter/msfilter/escherex.hxx>
#ifndef PPTX_EXPORT_ROTATE_CLOCKWISIFY #ifndef PPTX_EXPORT_ROTATE_CLOCKWISIFY
#define PPTX_EXPORT_ROTATE_CLOCKWISIFY(input) (21600000-input*600) #define PPTX_EXPORT_ROTATE_CLOCKWISIFY(input) ((21600000-input*600)%21600000)
#endif #endif
class Graphic; class Graphic;
......
...@@ -643,8 +643,14 @@ void DrawingML::WriteShapeTransformation( Reference< XShape > rXShape, sal_Int32 ...@@ -643,8 +643,14 @@ void DrawingML::WriteShapeTransformation( Reference< XShape > rXShape, sal_Int32
{ {
SdrObject* pShape = (SdrObject*) GetSdrObjectFromXShape( rXShape ); SdrObject* pShape = (SdrObject*) GetSdrObjectFromXShape( rXShape );
nRotation=pShape->GetRotateAngle(); nRotation=pShape->GetRotateAngle();
aPos.X-=(1-cos(nRotation*F_PI18000))*aSize.Width/2-sin(nRotation*F_PI18000)*aSize.Height/2; int faccos=bFlipV ? -1 : 1;
aPos.Y-=(1-cos(nRotation*F_PI18000))*aSize.Height/2+sin(nRotation*F_PI18000)*aSize.Width/2; int facsin=bFlipH ? -1 : 1;
aPos.X-=(1-faccos*cos(nRotation*F_PI18000))*aSize.Width/2-facsin*sin(nRotation*F_PI18000)*aSize.Height/2;
aPos.Y-=(1-faccos*cos(nRotation*F_PI18000))*aSize.Height/2+facsin*sin(nRotation*F_PI18000)*aSize.Width/2;
}
if (!bSuppressRotation)
{
if (bFlipV) {nRotation=(nRotation+18000)%36000;}
} }
WriteTransformation( Rectangle( Point( aPos.X, aPos.Y ), Size( aSize.Width, aSize.Height ) ), nXmlNamespace, bFlipH, bFlipV, PPTX_EXPORT_ROTATE_CLOCKWISIFY(nRotation) ); WriteTransformation( Rectangle( Point( aPos.X, aPos.Y ), Size( aSize.Width, aSize.Height ) ), nXmlNamespace, bFlipH, bFlipV, PPTX_EXPORT_ROTATE_CLOCKWISIFY(nRotation) );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment