mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 706323. Fix scrollbar smoothscrolling to get the timestamp the new way. r=dao
This commit is contained in:
parent
98a09a9d2b
commit
e21d394894
@ -287,12 +287,12 @@
|
||||
stop: function scrollAnim_stop() {
|
||||
this.started = false;
|
||||
},
|
||||
sample: function scrollAnim_handleEvent(event) {
|
||||
sample: function scrollAnim_handleEvent(timeStamp) {
|
||||
if (!this.started) {
|
||||
// We've been stopped
|
||||
return;
|
||||
}
|
||||
const timePassed = event.timeStamp - this.startTime;
|
||||
const timePassed = timeStamp - this.startTime;
|
||||
const pos = timePassed >= this.duration ? 1 :
|
||||
1 - Math.pow(1 - timePassed / this.duration, 4);
|
||||
|
||||
@ -656,14 +656,14 @@
|
||||
stop: function arrowSmoothScroll_stop() {
|
||||
this.started = false;
|
||||
},
|
||||
sample: function arrowSmoothScroll_handleEvent(event) {
|
||||
sample: function arrowSmoothScroll_handleEvent(timeStamp) {
|
||||
if (!this.started) {
|
||||
// We've been stopped
|
||||
return;
|
||||
}
|
||||
const scrollIndex = this.scrollbox._scrollIndex;
|
||||
const timePassed = event.timeStamp - this.lastFrameTime;
|
||||
this.lastFrameTime = event.timeStamp;
|
||||
const timePassed = timeStamp - this.lastFrameTime;
|
||||
this.lastFrameTime = timeStamp;
|
||||
|
||||
const scrollDelta = 0.5 * timePassed * scrollIndex;
|
||||
this.scrollbox.scrollPosition += scrollDelta;
|
||||
|
Loading…
Reference in New Issue
Block a user