Index: tools/telemetry/telemetry/page/actions/gesture_common.js |
diff --git a/tools/telemetry/telemetry/page/actions/gesture_common.js b/tools/telemetry/telemetry/page/actions/gesture_common.js |
index d977e37136f53f83fbad8312534bc82c54305f2f..1d21628d47053f97b741ca68680f14360398ecf0 100644 |
--- a/tools/telemetry/telemetry/page/actions/gesture_common.js |
+++ b/tools/telemetry/telemetry/page/actions/gesture_common.js |
@@ -13,6 +13,15 @@ |
left: bound.left, |
width: bound.width, |
height: bound.height }; |
+ if (rect.top < 0) { |
+ rect.height += rect.top; |
+ rect.top = 0; |
+ } |
+ if (rect.left < 0) { |
+ rect.width += rect.left; |
+ rect.left = 0; |
+ } |
+ |
var outsideHeight = (rect.top + rect.height) - window.innerHeight; |
var outsideWidth = (rect.left + rect.width) - window.innerWidth; |