summaryrefslogtreecommitdiff
path: root/basegfx
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2013-08-02 12:55:37 +0000
committerArmin Le Grand <alg@apache.org>2013-08-02 12:55:37 +0000
commitd9804cd7c4f01ac54dc5947bfefea2bc0296b414 (patch)
tree9a361b10acd895da11556f028bfc061164aecb3c /basegfx
parent269719ba0422aaf8f49cf3d579972ef2070716be (diff)
corrected first PolyPolygon handling stuff in xmloff
Diffstat (limited to 'basegfx')
-rw-r--r--basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx11
-rw-r--r--basegfx/source/matrix/b2dhommatrixtools.cxx23
2 files changed, 29 insertions, 5 deletions
diff --git a/basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx b/basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx
index b718896313e8..24b77edb7c10 100644
--- a/basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx
+++ b/basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx
@@ -187,10 +187,10 @@ namespace basegfx
class B2DHomMatrixBufferedDecompose
{
private:
- B2DVector maScale;
+ B2DVector maScale;
B2DPoint maTranslate;
- double mfRotate;
- double mfShearX;
+ double mfRotate;
+ double mfShearX;
public:
B2DHomMatrixBufferedDecompose(const B2DHomMatrix& rB2DHomMatrix = B2DHomMatrix())
@@ -236,12 +236,13 @@ namespace basegfx
bool mbDecomposed : 1;
bool mbCombined : 1;
+ void impDecompose();
+
void impCheckDecompose()
{
if(!mbDecomposed)
{
- maB2DHomMatrix.decompose(maScale, maTranslate, mfRotate, mfShearX);
- mbDecomposed = true;
+ impDecompose();
}
}
diff --git a/basegfx/source/matrix/b2dhommatrixtools.cxx b/basegfx/source/matrix/b2dhommatrixtools.cxx
index 900430da2799..fbbab06822ce 100644
--- a/basegfx/source/matrix/b2dhommatrixtools.cxx
+++ b/basegfx/source/matrix/b2dhommatrixtools.cxx
@@ -515,4 +515,27 @@ namespace basegfx
} // end of namespace basegfx
///////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ namespace tools
+ {
+ void B2DHomMatrixBufferedOnDemandDecompose::impDecompose()
+ {
+ maB2DHomMatrix.decompose(maScale, maTranslate, mfRotate, mfShearX);
+
+ if(maScale.getX() < 0.0 && maScale.getY() < 0.0)
+ {
+ // mirrored in X and Y, same as rotated by 180 degrees; prefer rotation
+ maScale.setX(-maScale.getX());
+ maScale.setY(-maScale.getY());
+ mfRotate = fmod(mfRotate + F_PI, F_2PI);
+ }
+
+ mbDecomposed = true;
+ }
+ } // end of namespace tools
+} // end of namespace basegfx
+
+///////////////////////////////////////////////////////////////////////////////
// eof