Index: Source/platform/transforms/AffineTransform.cpp |
diff --git a/Source/platform/transforms/AffineTransform.cpp b/Source/platform/transforms/AffineTransform.cpp |
index effb9df601047f879f925d31953641e05ef94923..44517294e4dadca823d55a9f4211f5c872bee1b1 100644 |
--- a/Source/platform/transforms/AffineTransform.cpp |
+++ b/Source/platform/transforms/AffineTransform.cpp |
@@ -134,7 +134,11 @@ AffineTransform& AffineTransform::multiply(const AffineTransform& other) |
AffineTransform& AffineTransform::rotate(double a) |
{ |
// angle is in degree. Switch to radian |
- a = deg2rad(a); |
+ return rotateRadians(deg2rad(a)); |
+} |
+ |
+AffineTransform& AffineTransform::rotateRadians(double a) |
+{ |
double cosAngle = cos(a); |
double sinAngle = sin(a); |
AffineTransform rot(cosAngle, sinAngle, -sinAngle, cosAngle, 0, 0); |
@@ -178,7 +182,7 @@ AffineTransform& AffineTransform::scaleNonUniform(double sx, double sy) |
AffineTransform& AffineTransform::rotateFromVector(double x, double y) |
{ |
- return rotate(rad2deg(atan2(y, x))); |
+ return rotateRadians(atan2(y, x)); |
} |
AffineTransform& AffineTransform::flipX() |
@@ -372,7 +376,7 @@ bool AffineTransform::decompose(DecomposedType& decomp) const |
double angle = atan2(m.b(), m.a()); |
// Remove rotation from matrix |
- m.rotate(rad2deg(-angle)); |
+ m.rotateRadians(-angle); |
// Return results |
decomp.scaleX = sx; |
@@ -396,7 +400,7 @@ void AffineTransform::recompose(const DecomposedType& decomp) |
this->setD(decomp.remainderD); |
this->setE(decomp.translateX); |
this->setF(decomp.translateY); |
- this->rotate(rad2deg(decomp.angle)); |
+ this->rotateRadians(decomp.angle); |
this->scale(decomp.scaleX, decomp.scaleY); |
} |