Bug 809199 - Update offsetViewportBy to take dx/dy instead of PointF. r=Cwiiis

This commit is contained in:
Kartikaya Gupta 2012-11-07 11:47:17 -05:00
parent 1659b1784a
commit 3c21360542
2 changed files with 7 additions and 7 deletions

View File

@ -152,8 +152,8 @@ public class ImmutableViewportMetrics {
newZoomFactor);
}
public ImmutableViewportMetrics offsetViewportBy(PointF delta) {
return setViewportOrigin(viewportRectLeft + delta.x, viewportRectTop + delta.y);
public ImmutableViewportMetrics offsetViewportBy(float dx, float dy) {
return setViewportOrigin(viewportRectLeft + dx, viewportRectTop + dy);
}
public ImmutableViewportMetrics setPageRect(RectF pageRect, RectF cssPageRect) {

View File

@ -480,8 +480,8 @@ public class PanZoomController
updatePosition();
}
private void scrollBy(PointF point) {
ImmutableViewportMetrics scrolled = getMetrics().offsetViewportBy(point);
private void scrollBy(float dx, float dy) {
ImmutableViewportMetrics scrolled = getMetrics().offsetViewportBy(dx, dy);
mTarget.setViewportMetrics(scrolled);
}
@ -575,7 +575,7 @@ public class PanZoomController
}
if (! mSubscroller.scrollBy(displacement)) {
synchronized (mTarget.getLock()) {
scrollBy(displacement);
scrollBy(displacement.x, displacement.y);
}
}
}
@ -886,8 +886,8 @@ public class PanZoomController
newZoomFactor = maxZoomFactor + excessZoom;
}
scrollBy(new PointF(mLastZoomFocus.x - detector.getFocusX(),
mLastZoomFocus.y - detector.getFocusY()));
scrollBy(mLastZoomFocus.x - detector.getFocusX(),
mLastZoomFocus.y - detector.getFocusY());
PointF focus = new PointF(detector.getFocusX(), detector.getFocusY());
scaleWithFocus(newZoomFactor, focus);
}