[calligra] libs/flake/svg: correct result of my own brain damage

Boudewijn Rempt boud at valdyas.org
Fri Apr 6 09:17:09 BST 2012


On Thursday 05 April 2012 Apr, Jan Hambrecht wrote:

It's maths so beyond me -- but if others agree that this is right, I can backport this morning.

> 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;
>  }
>  
> 


-- 
Boudewijn Rempt
http://www.valdyas.org, http://www.krita.org, http://www.boudewijnrempt.nl



More information about the calligra-devel mailing list