Chromium Code Reviews| Index: ui/gfx/animation/tween.cc |
| diff --git a/ui/gfx/animation/tween.cc b/ui/gfx/animation/tween.cc |
| index 483d772b5b4d47f4f7ba7f65d391f665df5819db..cf43ea5316f6b51062248054f665d25268379d1d 100644 |
| --- a/ui/gfx/animation/tween.cc |
| +++ b/ui/gfx/animation/tween.cc |
| @@ -71,7 +71,8 @@ double Tween::CalculateValue(Tween::Type type, double state) { |
| namespace { |
| uint8 FloatToColorByte(float f) { |
| - return std::min(std::max(ToRoundedInt(f * 255.f), 0), 255); |
| + return static_cast<uint8>( |
| + std::min(std::max(ToRoundedInt(f * 255.f), 0), 255)); |
| } |
| uint8 BlendColorComponents(uint8 start, |
| @@ -149,7 +150,8 @@ int Tween::IntValueBetween(double value, int start, int target) { |
| //static |
| int Tween::LinearIntValueBetween(double value, int start, int target) { |
| - return std::floor(0.5 + DoubleValueBetween(value, start, target)); |
| + return static_cast<int>( |
|
danakj
2014/10/18 18:40:06
Can you ToFlooredInt here instead of cast+std::flo
Peter Kasting
2014/10/20 23:38:56
I can do even better and use ToRoundedInt() to eli
|
| + std::floor(0.5 + DoubleValueBetween(value, start, target))); |
| } |
| // static |