Backed out changeset 684a5ca2efb7 (bug 858969) for Android M3 failures.
CLOSED TREE
This commit is contained in:
@@ -197,11 +197,6 @@ class JavaPanZoomController
|
||||
if (state != mState) {
|
||||
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("PanZoom:StateChange", state.toString()));
|
||||
mState = state;
|
||||
|
||||
// Let the target know we've finished with it (for now)
|
||||
if (state == PanZoomState.NOTHING) {
|
||||
mTarget.panZoomStopped();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -711,7 +706,8 @@ class JavaPanZoomController
|
||||
}
|
||||
|
||||
private void scrollBy(float dx, float dy) {
|
||||
mTarget.scrollBy(dx, dy);
|
||||
ImmutableViewportMetrics scrolled = getMetrics().offsetViewportBy(dx, dy);
|
||||
mTarget.setViewportMetrics(scrolled);
|
||||
}
|
||||
|
||||
private void fling() {
|
||||
@@ -1002,8 +998,8 @@ class JavaPanZoomController
|
||||
// Ensure minZoomFactor keeps the page at least as big as the viewport.
|
||||
if (pageRect.width() > 0) {
|
||||
float pageWidth = pageRect.width() +
|
||||
viewportMetrics.marginLeft +
|
||||
viewportMetrics.marginRight;
|
||||
viewportMetrics.fixedLayerMarginLeft +
|
||||
viewportMetrics.fixedLayerMarginRight;
|
||||
float scaleFactor = viewport.width() / pageWidth;
|
||||
minZoomFactor = Math.max(minZoomFactor, zoomFactor * scaleFactor);
|
||||
if (viewport.width() > pageWidth)
|
||||
@@ -1011,8 +1007,8 @@ class JavaPanZoomController
|
||||
}
|
||||
if (pageRect.height() > 0) {
|
||||
float pageHeight = pageRect.height() +
|
||||
viewportMetrics.marginTop +
|
||||
viewportMetrics.marginBottom;
|
||||
viewportMetrics.fixedLayerMarginTop +
|
||||
viewportMetrics.fixedLayerMarginBottom;
|
||||
float scaleFactor = viewport.height() / pageHeight;
|
||||
minZoomFactor = Math.max(minZoomFactor, zoomFactor * scaleFactor);
|
||||
if (viewport.height() > pageHeight)
|
||||
@@ -1047,9 +1043,15 @@ class JavaPanZoomController
|
||||
@Override
|
||||
protected float getViewportLength() { return getMetrics().getWidth(); }
|
||||
@Override
|
||||
protected float getPageStart() { return getMetrics().pageRectLeft; }
|
||||
protected float getPageStart() {
|
||||
ImmutableViewportMetrics metrics = getMetrics();
|
||||
return metrics.pageRectLeft - metrics.fixedLayerMarginLeft;
|
||||
}
|
||||
@Override
|
||||
protected float getPageLength() { return getMetrics().getPageWidthWithMargins(); }
|
||||
protected float getPageLength() {
|
||||
ImmutableViewportMetrics metrics = getMetrics();
|
||||
return metrics.getPageWidth() + metrics.fixedLayerMarginLeft + metrics.fixedLayerMarginRight;
|
||||
}
|
||||
}
|
||||
|
||||
private class AxisY extends Axis {
|
||||
@@ -1059,9 +1061,15 @@ class JavaPanZoomController
|
||||
@Override
|
||||
protected float getViewportLength() { return getMetrics().getHeight(); }
|
||||
@Override
|
||||
protected float getPageStart() { return getMetrics().pageRectTop; }
|
||||
protected float getPageStart() {
|
||||
ImmutableViewportMetrics metrics = getMetrics();
|
||||
return metrics.pageRectTop - metrics.fixedLayerMarginTop;
|
||||
}
|
||||
@Override
|
||||
protected float getPageLength() { return getMetrics().getPageHeightWithMargins(); }
|
||||
protected float getPageLength() {
|
||||
ImmutableViewportMetrics metrics = getMetrics();
|
||||
return metrics.getPageHeight() + metrics.fixedLayerMarginTop + metrics.fixedLayerMarginBottom;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user