mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 704690 - Abort flings on gecko viewport update [r=Cwiiis]
If the Java code is in the middle of a fling when Gecko sends a viewport update, abort the fling, cancel the velocity, and re-fling. The re-fling is purely to get the page snapped to an edge if needed.
This commit is contained in:
parent
e6126c1cc3
commit
c844bf872f
@ -163,14 +163,14 @@ public class LayerController {
|
||||
setForceRedraw();
|
||||
|
||||
notifyLayerClientOfGeometryChange();
|
||||
mPanZoomController.geometryChanged();
|
||||
mPanZoomController.geometryChanged(false);
|
||||
mView.requestRender();
|
||||
}
|
||||
|
||||
public void scrollTo(PointF point) {
|
||||
mViewportMetrics.setOrigin(point);
|
||||
notifyLayerClientOfGeometryChange();
|
||||
mPanZoomController.geometryChanged();
|
||||
mPanZoomController.geometryChanged(false);
|
||||
GeckoApp.mAppContext.repositionPluginViews(false);
|
||||
mView.requestRender();
|
||||
}
|
||||
@ -181,7 +181,7 @@ public class LayerController {
|
||||
mViewportMetrics.setOrigin(origin);
|
||||
|
||||
notifyLayerClientOfGeometryChange();
|
||||
mPanZoomController.geometryChanged();
|
||||
mPanZoomController.geometryChanged(false);
|
||||
GeckoApp.mAppContext.repositionPluginViews(false);
|
||||
mView.requestRender();
|
||||
}
|
||||
@ -189,7 +189,7 @@ public class LayerController {
|
||||
public void setViewport(RectF viewport) {
|
||||
mViewportMetrics.setViewport(viewport);
|
||||
notifyLayerClientOfGeometryChange();
|
||||
mPanZoomController.geometryChanged();
|
||||
mPanZoomController.geometryChanged(false);
|
||||
GeckoApp.mAppContext.repositionPluginViews(false);
|
||||
mView.requestRender();
|
||||
}
|
||||
@ -202,7 +202,7 @@ public class LayerController {
|
||||
|
||||
// Page size is owned by the LayerClient, so no need to notify it of
|
||||
// this change.
|
||||
mPanZoomController.geometryChanged();
|
||||
mPanZoomController.geometryChanged(false);
|
||||
mView.requestRender();
|
||||
}
|
||||
|
||||
@ -211,7 +211,7 @@ public class LayerController {
|
||||
|
||||
// We assume this was called by the LayerClient (as it includes page
|
||||
// size), so no need to notify it of this change.
|
||||
mPanZoomController.geometryChanged();
|
||||
mPanZoomController.geometryChanged(true);
|
||||
GeckoApp.mAppContext.repositionPluginViews(false);
|
||||
mView.requestRender();
|
||||
}
|
||||
|
@ -130,8 +130,23 @@ public class PanZoomController
|
||||
}
|
||||
}
|
||||
|
||||
public void geometryChanged() {
|
||||
public void geometryChanged(boolean aAbortFling) {
|
||||
populatePositionAndLength();
|
||||
|
||||
if (aAbortFling) {
|
||||
// this happens when gecko changes the viewport on us. if that's the case, abort
|
||||
// any fling that's in progress and re-fling so that the page snaps to edges. for
|
||||
// other cases (where the user's finger(s) are down) don't do anything special.
|
||||
switch (mState) {
|
||||
case FLING:
|
||||
mX.velocity = mY.velocity = 0.0f;
|
||||
mState = PanZoomState.NOTHING;
|
||||
// fall through
|
||||
case NOTHING:
|
||||
fling();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user