Chromium Code Reviews| Index: ui/gfx/geometry/size_f.h |
| diff --git a/ui/gfx/geometry/size_f.h b/ui/gfx/geometry/size_f.h |
| index 66080f09c12d660c78bcab789e5e6caaeb38597e..18f17e4e9af85ee37e8f61bf9b4fd38f5f06bd6b 100644 |
| --- a/ui/gfx/geometry/size_f.h |
| +++ b/ui/gfx/geometry/size_f.h |
| @@ -10,6 +10,7 @@ |
| #include <string> |
| #include "base/compiler_specific.h" |
| +#include "ui/gfx/geometry/size.h" |
| #include "ui/gfx/gfx_export.h" |
| namespace gfx { |
| @@ -22,6 +23,11 @@ class GFX_EXPORT SizeF { |
| : width_(fmaxf(0, width)), height_(fmaxf(0, height)) {} |
| ~SizeF() {} |
| + explicit SizeF(const Size& size) |
| + // TODO(danakj): Change these to checked_cast? |
|
vmpstr
2015/09/23 23:04:25
Why?
danakj
2015/09/23 23:08:20
Well, I think that putting an int that is too big
|
| + : SizeF(static_cast<float>(size.width()), |
| + static_cast<float>(size.height())) {} |
| + |
| float width() const { return width_; } |
| float height() const { return height_; } |