Message info
 
To:kde-commits@kde.org From:Jan Hambrecht Subject:[calligra] libs/flake/svg: correct result of my own brain damage Date:Thu, 5 Apr 2012 23:09:41 +0200 (CEST)
 

Git commit b5aa47b0459e9a51eb28cca423ad19e162e160de by Jan Hambrecht.
Committed on 05/04/2012 at 23:10.
Pushed by jaham into branch 'master'.

correct result of my own brain damage

this fixes parsing the skewX skewY svg transformations

please review and apply to 2.4 if appropriate

BUG: 297544

M +6 -6 libs/flake/svg/SvgUtil.cpp

http://commits.kde.org/calligra/b5aa47b0459e9a51eb28cca423ad19e162e160de

diff --git a/libs/flake/svg/SvgUtil.cpp b/libs/flake/svg/SvgUtil.cpp
index b6f11d8..e500701 100644
--- a/libs/flake/svg/SvgUtil.cpp
+++ b/libs/flake/svg/SvgUtil.cpp
@@ -30,7 +30,7 @@

#define DPI 72.0

-#define DEG2RAD(degree) degree*180.0/M_PI
+#define DEG2RAD(degree) degree/180.0*M_PI

double SvgUtil::fromUserSpace(double value)
{
@@ -117,20 +117,20 @@ QTransform SvgUtil::parseTransform(const QString &transform)
QStringList subtransform = (*it).simplified().split('(', QString::SkipEmptyParts);
if (subtransform.count() < 2)
continue;
-
+
subtransform[0] = subtransform[0].trimmed().toLower();
subtransform[1] = subtransform[1].simplified();
QRegExp reg("[,( ]");
QStringList params = subtransform[1].split(reg, QString::SkipEmptyParts);
-
+
if (subtransform[0].startsWith(';') || subtransform[0].startsWith(','))
subtransform[0] = subtransform[0].right(subtransform[0].length() - 1);
-
+
if (subtransform[0] == "rotate") {
if (params.count() == 3) {
double x = params[1].toDouble();
double y = params[2].toDouble();
-
+
result.translate(x, y);
result.rotate(params[0].toDouble());
result.translate(-x, -y);
@@ -163,7 +163,7 @@ QTransform SvgUtil::parseTransform(const QString &transform)
}
}
}
-
+
return result;
}