Chromium Code Reviews| Index: ui/base/gestures/gesture_sequence.cc |
| diff --git a/ui/base/gestures/gesture_sequence.cc b/ui/base/gestures/gesture_sequence.cc |
| index c4a6d316fa7718f584d9cd3fd22108110c3ef5e4..befae4ed9700a90c9057814a20b10b2c4bc6c174 100644 |
| --- a/ui/base/gestures/gesture_sequence.cc |
| +++ b/ui/base/gestures/gesture_sequence.cc |
| @@ -588,6 +588,7 @@ void GestureSequence::RecreateBoundingBox() { |
| } else { |
|
sadrul
2012/11/12 01:28:02
You can set bounding_box_ to empty when point_coun
danakj
2012/11/12 05:45:56
Done.
|
| int left = INT_MAX / 20, top = INT_MAX / 20; |
| int right = INT_MIN / 20, bottom = INT_MIN / 20; |
| + bool empty_box = true; |
| for (int i = 0; i < kMaxGesturePoints; ++i) { |
| if (!points_[i].in_use()) |
| continue; |
| @@ -600,8 +601,12 @@ void GestureSequence::RecreateBoundingBox() { |
| right = std::max(right, point.x()); |
| top = std::min(top, point.y()); |
| bottom = std::max(bottom, point.y()); |
| + empty_box = false; |
| } |
| - bounding_box_.SetRect(left, top, right - left, bottom - top); |
| + if (empty_box) |
| + bounding_box_.SetRect(0, 0, 0, 0); |
| + else |
| + bounding_box_.SetRect(left, top, right - left, bottom - top); |
| } |
| } |