Index: cc/base/math_util.cc |
diff --git a/cc/base/math_util.cc b/cc/base/math_util.cc |
index eeb1523db46a080aff9850caaf126c1c3f8b0509..76b2bb93cc325f0dd77fa35090ba5230c9dbbd6a 100644 |
--- a/cc/base/math_util.cc |
+++ b/cc/base/math_util.cc |
@@ -466,6 +466,13 @@ gfx::RectF MathUtil::ScaleRectProportional(const gfx::RectF& input_outer_rect, |
} |
static inline float ScaleOnAxis(double a, double b, double c) { |
+ if (!b && !c) |
+ return a; |
+ if (!a && !c) |
+ return b; |
+ if (!a && !b) |
+ return c; |
+ |
// Do the sqrt as a double to not lose precision. |
return static_cast<float>(std::sqrt(a * a + b * b + c * c)); |
} |