Index: Source/core/html/canvas/CanvasPathMethods.cpp |
diff --git a/Source/core/html/canvas/CanvasPathMethods.cpp b/Source/core/html/canvas/CanvasPathMethods.cpp |
index 85a13a49e65878d060ad0f58e72d77facd684638..a18165c99a179341ec84029b5c79831fd3b26861 100644 |
--- a/Source/core/html/canvas/CanvasPathMethods.cpp |
+++ b/Source/core/html/canvas/CanvasPathMethods.cpp |
@@ -180,9 +180,14 @@ void canonicalizeAngle(float* startAngle, float* endAngle) |
{ |
// Make 0 <= startAngle < 2*PI |
float newStartAngle = fmodf(*startAngle, twoPiFloat); |
+ |
if (newStartAngle < 0) |
newStartAngle += twoPiFloat; |
+ // Compensate for numerical precision issues in fmodf (c.f. crbug.com/503422) |
Stephen White
2015/06/26 15:38:21
This is probably just loss of precision on the + a
|
+ if (newStartAngle >= twoPiFloat) |
+ newStartAngle -= twoPiFloat; |
+ |
float delta = newStartAngle - *startAngle; |
*startAngle = newStartAngle; |
*endAngle = *endAngle + delta; |