| Index: content/browser/renderer_host/input/synthetic_touchscreen_pinch_gesture.cc
|
| diff --git a/content/browser/renderer_host/input/synthetic_touchscreen_pinch_gesture.cc b/content/browser/renderer_host/input/synthetic_touchscreen_pinch_gesture.cc
|
| index 8daff81a14c7d69fc08b60b5b4263a15425c335d..118003f1dcb7cb25ae4c2b9291b446ec1e95e4db 100644
|
| --- a/content/browser/renderer_host/input/synthetic_touchscreen_pinch_gesture.cc
|
| +++ b/content/browser/renderer_host/input/synthetic_touchscreen_pinch_gesture.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include <stdint.h>
|
|
|
| +#include <algorithm>
|
| #include <cmath>
|
|
|
| #include "base/logging.h"
|
| @@ -96,9 +97,11 @@ void SyntheticTouchscreenPinchGesture::MoveTouchPoints(
|
| SyntheticGestureTarget* target,
|
| float delta,
|
| const base::TimeTicks& timestamp) {
|
| + gfx::Size view_size = target->GetViewSize();
|
| // The two pointers move in opposite directions.
|
| - float current_y_0 = start_y_0_ + delta;
|
| - float current_y_1 = start_y_1_ - delta;
|
| + float current_y_0 = std::max(start_y_0_ + delta, 0.f);
|
| + float current_y_1 =
|
| + std::min(start_y_1_ - delta, static_cast<float>(view_size.height() - 1));
|
|
|
| synthetic_pointer_driver_->Move(params_.anchor.x(), current_y_0, 0);
|
| synthetic_pointer_driver_->Move(params_.anchor.x(), current_y_1, 1);
|
| @@ -132,8 +135,10 @@ void SyntheticTouchscreenPinchGesture::SetupCoordinatesAndStopTime(
|
| target->GetTouchSlopInDips();
|
| }
|
|
|
| - start_y_0_ = params_.anchor.y() - initial_distance_to_anchor;
|
| - start_y_1_ = params_.anchor.y() + initial_distance_to_anchor;
|
| + gfx::Size view_size = target->GetViewSize();
|
| + start_y_0_ = std::max(params_.anchor.y() - initial_distance_to_anchor, 0.f);
|
| + start_y_1_ = std::min(params_.anchor.y() + initial_distance_to_anchor,
|
| + static_cast<float>(view_size.height() - 1));
|
|
|
| max_pointer_delta_0_ = initial_distance_to_anchor - final_distance_to_anchor;
|
|
|
|
|