[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - filter/source
Thorsten Behrens
thorsten at kemper.freedesktop.org
Wed Apr 11 07:52:53 PDT 2012
filter/source/svg/parserfragments.cxx | 8 ++++----
filter/source/svg/svgreader.cxx | 9 +++++----
2 files changed, 9 insertions(+), 8 deletions(-)
New commits:
commit 6a763c4bcd1100ff14625cb924e7672866708c3d
Author: Christina Rossmanith <ChrRossmanith at web.de>
Date: Sun Apr 1 21:14:10 2012 +0200
SVG: treat skewX and skewY correct
Signed-off-by: Thorsten Behrens <tbehrens at suse.com>
diff --git a/filter/source/svg/parserfragments.cxx b/filter/source/svg/parserfragments.cxx
index 4edd90f..d4b31f2 100644
--- a/filter/source/svg/parserfragments.cxx
+++ b/filter/source/svg/parserfragments.cxx
@@ -93,16 +93,16 @@ void calcRotation(std::vector<geometry::AffineMatrix2D>& rTransforms,
void calcSkewX(std::vector<geometry::AffineMatrix2D>& rTransforms,
double fSkewAngle)
{
- geometry::AffineMatrix2D aMat(1.0,0.0,0.0,
- tan(fSkewAngle*M_PI/180),1.0,0.0);
+ geometry::AffineMatrix2D aMat(1.0,tan(fSkewAngle*M_PI/180),0.0,
+ 0.0,1.0,0.0);
rTransforms.push_back(aMat);
}
void calcSkewY(std::vector<geometry::AffineMatrix2D>& rTransforms,
double fSkewAngle)
{
- geometry::AffineMatrix2D aMat(1.0,tan(fSkewAngle*M_PI/180),0.0,
- 0.0,1.0,0.0);
+ geometry::AffineMatrix2D aMat(1.0,0.0,0.0,
+ tan(fSkewAngle*M_PI/180),1.0,0.0);
rTransforms.push_back(aMat);
}
commit 4567e9cd0126e6a718fa5b09a96df160538cbe2a
Author: Christina Rossmanith <ChrRossmanith at web.de>
Date: Sat Mar 17 22:06:22 2012 +0100
SVG import: keep aspect ratio when transforming viewbox to viewport
Signed-off-by: Thorsten Behrens <tbehrens at suse.com>
diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx
index 796bea9..c25d183 100644
--- a/filter/source/svg/svgreader.cxx
+++ b/filter/source/svg/svgreader.cxx
@@ -293,12 +293,13 @@ struct AnnotatingVisitor
maCurrState.maViewBox.getWidth() != 0.0 &&
maCurrState.maViewBox.getHeight() != 0.0 )
{
- // transform aViewBox into viewport, such that they
- // coincide
+ // transform aViewBox into viewport, keep aspect ratio
aLocalTransform.translate(-maCurrState.maViewBox.getMinX(),
-maCurrState.maViewBox.getMinY());
- aLocalTransform.scale(maCurrState.maViewport.getWidth()/maCurrState.maViewBox.getWidth(),
- maCurrState.maViewport.getHeight()/maCurrState.maViewBox.getHeight());
+ double scaleW = maCurrState.maViewport.getWidth()/maCurrState.maViewBox.getWidth();
+ double scaleH = maCurrState.maViewport.getHeight()/maCurrState.maViewBox.getHeight();
+ double scale = (scaleW < scaleH) ? scaleW : scaleH;
+ aLocalTransform.scale(scale,scale);
}
maCurrState.maCTM = maCurrState.maCTM*maCurrState.maTransform*aLocalTransform;
More information about the Libreoffice-commits
mailing list