Skip to content

Commit cfef7a2

Browse files
committed
Merge pull request appium#289 from kkhaidukov/master
fixed zoom gestures in AppiumDriver.java (issue appium#288)
2 parents f305b95 + d22c889 commit cfef7a2

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/main/java/io/appium/java_client/AppiumDriver.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,8 @@ public void zoom(WebElement el) {
446446
Point center = new Point(upperLeft.getX() + dimensions.getWidth() / 2, upperLeft.getY() + dimensions.getHeight() / 2);
447447
int yOffset = center.getY() - upperLeft.getY();
448448

449-
TouchAction action0 = new TouchAction(this).press(el).moveTo(el, center.getX(), center.getY() - yOffset).release();
450-
TouchAction action1 = new TouchAction(this).press(el).moveTo(el, center.getX(), center.getY() + yOffset).release();
449+
TouchAction action0 = new TouchAction(this).press(center.getX(), center.getY()).moveTo(el, center.getX(), center.getY() - yOffset).release();
450+
TouchAction action1 = new TouchAction(this).press(center.getX(), center.getY()).moveTo(el, center.getX(), center.getY() + yOffset).release();
451451

452452
multiTouch.add(action0).add(action1);
453453

@@ -477,8 +477,8 @@ public void zoom(int x, int y) {
477477
yOffset = scrHeight - y;
478478
}
479479

480-
TouchAction action0 = new TouchAction(this).press(x, y).moveTo(x, y - yOffset).release();
481-
TouchAction action1 = new TouchAction(this).press(x, y).moveTo(x, y + yOffset).release();
480+
TouchAction action0 = new TouchAction(this).press(x, y).moveTo(0, -yOffset).release();
481+
TouchAction action1 = new TouchAction(this).press(x, y).moveTo(0, yOffset).release();
482482

483483
multiTouch.add(action0).add(action1);
484484

0 commit comments

Comments
 (0)