Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1201)

Unified Diff: Source/core/html/canvas/CanvasPathMethods.cpp

Issue 1212423002: Fixing bad angle computation in 2D canvas arc rendering (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/canvas/bug503422-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « LayoutTests/fast/canvas/bug503422-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698