Index: Source/core/html/canvas/CanvasPathMethods.cpp |
diff --git a/Source/core/html/canvas/CanvasPathMethods.cpp b/Source/core/html/canvas/CanvasPathMethods.cpp |
index 37df15d162ead38e8d0aec5fe0534a62095e5b1b..85a13a49e65878d060ad0f58e72d77facd684638 100644 |
--- a/Source/core/html/canvas/CanvasPathMethods.cpp |
+++ b/Source/core/html/canvas/CanvasPathMethods.cpp |
@@ -179,15 +179,14 @@ inline FloatPoint getPointOnEllipse(float radiusX, float radiusY, float theta) |
void canonicalizeAngle(float* startAngle, float* endAngle) |
{ |
// Make 0 <= startAngle < 2*PI |
- float newStartAngle = *startAngle; |
+ float newStartAngle = fmodf(*startAngle, twoPiFloat); |
if (newStartAngle < 0) |
- newStartAngle = twoPiFloat + fmodf(newStartAngle, -twoPiFloat); |
- else |
- newStartAngle = fmodf(newStartAngle, twoPiFloat); |
+ newStartAngle += twoPiFloat; |
float delta = newStartAngle - *startAngle; |
*startAngle = newStartAngle; |
*endAngle = *endAngle + delta; |
+ |
ASSERT(newStartAngle >= 0 && newStartAngle < twoPiFloat); |
} |