Backed out changeset b84baa03b9d1 (bug 868341) for mochitest -4 and bc testfailures
This commit is contained in:
@@ -245,16 +245,12 @@ class JavaPanZoomController
|
||||
final RectF zoomRect = new RectF(x, y,
|
||||
x + (float)message.getDouble("w"),
|
||||
y + (float)message.getDouble("h"));
|
||||
if (message.optBoolean("animate", true)) {
|
||||
mTarget.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
animatedZoomTo(zoomRect);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
mTarget.setViewportMetrics(getMetricsToZoomTo(zoomRect));
|
||||
}
|
||||
mTarget.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
animatedZoomTo(zoomRect);
|
||||
}
|
||||
});
|
||||
} else if (MESSAGE_ZOOM_PAGE.equals(event)) {
|
||||
ImmutableViewportMetrics metrics = getMetrics();
|
||||
RectF cssPageRect = metrics.getCssPageRect();
|
||||
@@ -268,16 +264,12 @@ class JavaPanZoomController
|
||||
y + dh/2,
|
||||
cssPageRect.width(),
|
||||
y + dh/2 + newHeight);
|
||||
if (message.optBoolean("animate", true)) {
|
||||
mTarget.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
animatedZoomTo(r);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
mTarget.setViewportMetrics(getMetricsToZoomTo(r));
|
||||
}
|
||||
mTarget.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
animatedZoomTo(r);
|
||||
}
|
||||
});
|
||||
} else if (MESSAGE_TOUCH_LISTENER.equals(event)) {
|
||||
int tabId = message.getInt("tabID");
|
||||
final Tab tab = Tabs.getInstance().getTab(tabId);
|
||||
@@ -1407,7 +1399,7 @@ class JavaPanZoomController
|
||||
* While we usually use device pixels, @zoomToRect must be specified in CSS
|
||||
* pixels.
|
||||
*/
|
||||
private ImmutableViewportMetrics getMetricsToZoomTo(RectF zoomToRect) {
|
||||
private boolean animatedZoomTo(RectF zoomToRect) {
|
||||
final float startZoom = getMetrics().zoomFactor;
|
||||
|
||||
RectF viewport = getMetrics().getViewport();
|
||||
@@ -1442,11 +1434,8 @@ class JavaPanZoomController
|
||||
// 2. now run getValidViewportMetrics on it, so that the target viewport is
|
||||
// clamped down to prevent overscroll, over-zoom, and other bad conditions.
|
||||
finalMetrics = getValidViewportMetrics(finalMetrics);
|
||||
return finalMetrics;
|
||||
}
|
||||
|
||||
private boolean animatedZoomTo(RectF zoomToRect) {
|
||||
bounce(getMetricsToZoomTo(zoomToRect), PanZoomState.ANIMATED_ZOOM);
|
||||
bounce(finalMetrics, PanZoomState.ANIMATED_ZOOM);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user