mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1201076 - Don't clobber the page rect update if one comes in while in the middle of a bounce animation. r=snorp
This commit is contained in:
parent
50db7bf6c8
commit
5da7557499
@ -219,6 +219,17 @@ public class ImmutableViewportMetrics {
|
||||
zoomFactor, isRTL);
|
||||
}
|
||||
|
||||
public ImmutableViewportMetrics setPageRectFrom(ImmutableViewportMetrics aMetrics) {
|
||||
if (aMetrics.cssPageRectLeft == cssPageRectLeft &&
|
||||
aMetrics.cssPageRectTop == cssPageRectTop &&
|
||||
aMetrics.cssPageRectRight == cssPageRectRight &&
|
||||
aMetrics.cssPageRectBottom == cssPageRectBottom) {
|
||||
return this;
|
||||
}
|
||||
RectF css = aMetrics.getCssPageRect();
|
||||
return setPageRect(RectUtils.scale(css, zoomFactor), css);
|
||||
}
|
||||
|
||||
public ImmutableViewportMetrics setIsRTL(boolean aIsRTL) {
|
||||
if (isRTL == aIsRTL) {
|
||||
return this;
|
||||
|
@ -950,14 +950,14 @@ class JavaPanZoomController
|
||||
synchronized (mTarget.getLock()) {
|
||||
float t = easeOut((float)mBounceDuration / BOUNCE_ANIMATION_DURATION);
|
||||
ImmutableViewportMetrics newMetrics = mBounceStartMetrics.interpolate(mBounceEndMetrics, t);
|
||||
mTarget.setViewportMetrics(newMetrics);
|
||||
mTarget.setViewportMetrics(newMetrics.setPageRectFrom(getMetrics()));
|
||||
}
|
||||
}
|
||||
|
||||
/* Concludes a bounce animation and snaps the viewport into place. */
|
||||
private void finishBounce() {
|
||||
synchronized (mTarget.getLock()) {
|
||||
mTarget.setViewportMetrics(mBounceEndMetrics);
|
||||
mTarget.setViewportMetrics(mBounceEndMetrics.setPageRectFrom(getMetrics()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user