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

Unified Diff: third_party/WebKit/Source/core/svg/SVGTransform.cpp

Issue 2342913003: Replace narrowPrecisionToFloat with clampTo<float> (Closed)
Patch Set: Created 4 years, 3 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
Index: third_party/WebKit/Source/core/svg/SVGTransform.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGTransform.cpp b/third_party/WebKit/Source/core/svg/SVGTransform.cpp
index 8e468bd6fee31a5d5eb63e45cd186eda74a24224..8833688f0a1d2fcd6e21477eb60b953af891a56f 100644
--- a/third_party/WebKit/Source/core/svg/SVGTransform.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGTransform.cpp
@@ -20,7 +20,6 @@
#include "core/svg/SVGTransform.h"
-#include "platform/FloatConversion.h"
#include "platform/geometry/FloatSize.h"
#include "wtf/MathExtras.h"
#include "wtf/text/StringBuilder.h"
@@ -202,8 +201,8 @@ String SVGTransform::valueAsString() const
double angleInRad = deg2rad(m_angle);
double cosAngle = cos(angleInRad);
double sinAngle = sin(angleInRad);
- float cx = narrowPrecisionToFloat(cosAngle != 1 ? (m_matrix.e() * (1 - cosAngle) - m_matrix.f() * sinAngle) / (1 - cosAngle) / 2 : 0);
- float cy = narrowPrecisionToFloat(cosAngle != 1 ? (m_matrix.e() * sinAngle / (1 - cosAngle) + m_matrix.f()) / 2 : 0);
+ float cx = clampTo<float>(cosAngle != 1 ? (m_matrix.e() * (1 - cosAngle) - m_matrix.f() * sinAngle) / (1 - cosAngle) / 2 : 0);
+ float cy = clampTo<float>(cosAngle != 1 ? (m_matrix.e() * sinAngle / (1 - cosAngle) + m_matrix.f()) / 2 : 0);
if (cx || cy) {
arguments[argumentCount++] = cx;
arguments[argumentCount++] = cy;
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGSVGElement.cpp ('k') | third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698