Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(897)

Unified Diff: ui/gfx/size_base.h

Issue 10996037: Do not convert from RectF to Rect by flooring. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/gfx/size_base.h
diff --git a/ui/gfx/size_base.h b/ui/gfx/size_base.h
index ef687c697d9dd15bd21837b2b4e10c6ab5b9dbbe..5f94ac5936a5ebc3977c567417a22ab65b9db46d 100644
--- a/ui/gfx/size_base.h
+++ b/ui/gfx/size_base.h
@@ -53,8 +53,15 @@ class UI_EXPORT SizeBase {
}
bool IsEmpty() const {
- // Size doesn't allow negative dimensions, so testing for 0 is enough.
- return (width_ == 0) || (height_ == 0);
+ return (width_ <= 0) || (height_ <= 0);
+ }
+
+ void set_allow_negative_size(bool allow) {
+ allow_negative_size_ = allow;
+ }
+
+ void set_crash_if_negative(bool crash) {
+ crash_if_negative_ = crash;
}
protected:
@@ -64,6 +71,8 @@ class UI_EXPORT SizeBase {
~SizeBase();
private:
+ bool allow_negative_size_;
sky 2012/09/27 17:48:30 Having special cases where Size is some times nega
+ bool crash_if_negative_;
Type width_;
Type height_;
};
« ui/gfx/rect.h ('K') | « ui/gfx/safe_floor_ceil.cc ('k') | ui/gfx/size_base_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698