| Index: ui/gfx/size_base.h
|
| ===================================================================
|
| --- ui/gfx/size_base.h (revision 167065)
|
| +++ ui/gfx/size_base.h (working copy)
|
| @@ -32,8 +32,8 @@
|
| set_height(height_ + height);
|
| }
|
|
|
| - void set_width(Type width);
|
| - void set_height(Type height);
|
| + void set_width(Type width) { width_ = width; }
|
| + void set_height(Type height) { height_ = height; }
|
|
|
| void ClampToMax(const Class& max) {
|
| width_ = width_ <= max.width_ ? width_ : max.width_;
|
| @@ -46,11 +46,20 @@
|
| }
|
|
|
| bool IsEmpty() const {
|
| - return (width_ == 0) || (height_ == 0);
|
| + return (width_ <= 0) || (height_ <= 0);
|
| }
|
|
|
| + void ClampToNonNegative() {
|
| + if (width_ < 0)
|
| + width_ = 0;
|
| + if (height_ < 0)
|
| + height_ = 0;
|
| + }
|
| +
|
| protected:
|
| - SizeBase(Type width, Type height);
|
| + SizeBase(Type width, Type height)
|
| + : width_(width),
|
| + height_(height) {}
|
|
|
| // Destructor is intentionally made non virtual and protected.
|
| // Do not make this public.
|
|
|