summaryrefslogtreecommitdiffstats
path: root/cc/math_util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc/math_util.cc')
-rw-r--r--cc/math_util.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/cc/math_util.cc b/cc/math_util.cc
index 46d1c27..38b609b 100644
--- a/cc/math_util.cc
+++ b/cc/math_util.cc
@@ -383,10 +383,10 @@ static inline float scaleOnAxis(double a, double b, double c)
return std::sqrt(a * a + b * b + c * c);
}
-gfx::Vector2dF MathUtil::computeTransform2dScaleComponents(const gfx::Transform& transform)
+gfx::Vector2dF MathUtil::computeTransform2dScaleComponents(const gfx::Transform& transform, float fallbackValue)
{
if (transform.HasPerspective())
- return gfx::Vector2dF(1, 1);
+ return gfx::Vector2dF(fallbackValue, fallbackValue);
float xScale = scaleOnAxis(transform.matrix().getDouble(0, 0), transform.matrix().getDouble(1, 0), transform.matrix().getDouble(2, 0));
float yScale = scaleOnAxis(transform.matrix().getDouble(0, 1), transform.matrix().getDouble(1, 1), transform.matrix().getDouble(2, 1));
return gfx::Vector2dF(xScale, yScale);