| Index: Source/platform/LayoutUnit.h
|
| diff --git a/Source/platform/LayoutUnit.h b/Source/platform/LayoutUnit.h
|
| index 4f677d1dd60f97ad79948760415d97bdbe7cf79e..e931ced19ca4048a14c083c604a00dbc55007c30 100644
|
| --- a/Source/platform/LayoutUnit.h
|
| +++ b/Source/platform/LayoutUnit.h
|
| @@ -220,14 +220,21 @@
|
| return ::fabs(value) <= std::numeric_limits<int>::max() / kFixedPointDenominator;
|
| }
|
|
|
| - ALWAYS_INLINE void setValue(int value)
|
| - {
|
| - m_value = saturatedSet(value, kLayoutUnitFractionalBits);
|
| - }
|
| -
|
| + inline void setValue(int value)
|
| + {
|
| + if (value > intMaxForLayoutUnit)
|
| + m_value = std::numeric_limits<int>::max();
|
| + else if (value < intMinForLayoutUnit)
|
| + m_value = std::numeric_limits<int>::min();
|
| + else
|
| + m_value = value * kFixedPointDenominator;
|
| + }
|
| inline void setValue(unsigned value)
|
| {
|
| - m_value = saturatedSet(value, kLayoutUnitFractionalBits);
|
| + if (value >= static_cast<unsigned>(intMaxForLayoutUnit))
|
| + m_value = std::numeric_limits<int>::max();
|
| + else
|
| + m_value = value * kFixedPointDenominator;
|
| }
|
|
|
| int m_value;
|
|
|