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

Unified Diff: Source/platform/text/TextStream.cpp

Issue 863873003: Fix unnecessary output of decimals in SVG tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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/svg/batik/masking/maskRegions-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/text/TextStream.cpp
diff --git a/Source/platform/text/TextStream.cpp b/Source/platform/text/TextStream.cpp
index 0a7225cfae51545c3b85208e1e7a32b493fcd536..470eb2b9d523f03e5278564386d5511aa98bee91 100644
--- a/Source/platform/text/TextStream.cpp
+++ b/Source/platform/text/TextStream.cpp
@@ -43,7 +43,7 @@ static inline bool hasFractions(double val)
{
// We use 0.011 to more than match the number of significant digits we print out when dumping the render tree.
static const double s_epsilon = 0.011;
- int ival = static_cast<int>(val);
+ int ival = static_cast<int>(round(val));
double dval = static_cast<double>(ival);
return fabs(val - dval) > s_epsilon;
}
@@ -125,7 +125,7 @@ TextStream& TextStream::operator<<(const FormatNumberRespectingIntegers& numberT
if (hasFractions(numberToFormat.value))
return *this << numberToFormat.value;
- m_text.appendNumber(static_cast<int>(numberToFormat.value));
+ m_text.appendNumber(static_cast<int>(round(numberToFormat.value)));
return *this;
}
« no previous file with comments | « LayoutTests/svg/batik/masking/maskRegions-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698