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; |
} |