diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-08 16:02:05 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-08 16:02:05 +0000 |
commit | 190d06bf03d4c310f042396046b2b5b5f7af43cf (patch) | |
tree | d2b11881ccfe6f6c78557b83f14fe9c64d7d1b21 /ui/base | |
parent | 41b9266435fba2235d705ee0df8ca960b3c72f03 (diff) | |
download | chromium_src-190d06bf03d4c310f042396046b2b5b5f7af43cf.zip chromium_src-190d06bf03d4c310f042396046b2b5b5f7af43cf.tar.gz chromium_src-190d06bf03d4c310f042396046b2b5b5f7af43cf.tar.bz2 |
ui: Remove gfx::Size::ClampToNonNegative, prevent negative sizes always.
This was added with the intention of using Size as a vector, replacing use of
IntSize. Since we have Vector2d now, negative sizes should not exist, so clamp
them in set_width/set_height and the constructor.
Not covered by tests, as we can't test DCHECKs.
TBR=sky
BUG=160158
Relanding: https://codereview.chromium.org/11365160/
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=167255
Review URL: https://chromiumcodereview.appspot.com/11410024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175535 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base')
-rw-r--r-- | ui/base/gestures/gesture_sequence.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/base/gestures/gesture_sequence.cc b/ui/base/gestures/gesture_sequence.cc index 75932ec..56c12a8 100644 --- a/ui/base/gestures/gesture_sequence.cc +++ b/ui/base/gestures/gesture_sequence.cc @@ -537,7 +537,9 @@ GestureSequence::Gestures* GestureSequence::ProcessTouchEventForGesture( void GestureSequence::RecreateBoundingBox() { // TODO(sad): Recreating the bounding box at every touch-event is not very // efficient. This should be made better. - if (point_count_ == 1) { + if (point_count_ == 0) { + bounding_box_.SetRect(0, 0, 0, 0); + } else if (point_count_ == 1) { bounding_box_ = GetPointByPointId(0)->enclosing_rectangle(); } else { int left = INT_MAX / 20, top = INT_MAX / 20; |