| Index: cc/CCMathUtil.cpp
|
| diff --git a/cc/CCMathUtil.cpp b/cc/CCMathUtil.cpp
|
| index d90eb090abef6fbc004f87cedc0a3188419486cf..6377f645f9cb0ad99f547524b342425f21f3a779 100644
|
| --- a/cc/CCMathUtil.cpp
|
| +++ b/cc/CCMathUtil.cpp
|
| @@ -361,6 +361,13 @@ void CCMathUtil::flattenTransformTo2d(WebTransformationMatrix& transform)
|
| transform.setM43(0);
|
| }
|
|
|
| +FloatPoint CCMathUtil::computeTransform2dScaleComponents(const WebTransformationMatrix& transform)
|
| +{
|
| + FloatPoint3D xAxis(transform.m11(), transform.m12(), transform.m13());
|
| + FloatPoint3D yAxis(transform.m21(), transform.m22(), transform.m23());
|
| + return FloatPoint(xAxis.distanceTo(FloatPoint3D()), yAxis.distanceTo(FloatPoint3D()));
|
| +}
|
| +
|
| float CCMathUtil::smallestAngleBetweenVectors(const FloatSize& v1, const FloatSize& v2)
|
| {
|
| float dotProduct = (v1.width() * v2.width() + v1.height() * v2.height()) / (v1.diagonalLength() * v2.diagonalLength());
|
|
|