зеркало из https://github.com/mozilla/pjs.git
Bug 398965 - "tab bar smooth-scrolling performance problems" (avoid closure) [p=dao@mozilla.com (D��o Gottwald) r=Enn a1.9=mconnor]
This commit is contained in:
Родитель
dbcf3210d1
Коммит
6e1f8a20dd
|
@ -162,7 +162,7 @@
|
||||||
round = Math.ceil;
|
round = Math.ceil;
|
||||||
}
|
}
|
||||||
|
|
||||||
function processFrame(self) {
|
function processFrame(self, scrollAmounts) {
|
||||||
self.scrollBoxObject.scrollBy(scrollAmounts.shift(), 0);
|
self.scrollBoxObject.scrollBy(scrollAmounts.shift(), 0);
|
||||||
if (!scrollAmounts.length)
|
if (!scrollAmounts.length)
|
||||||
self._stopSmoothScroll();
|
self._stopSmoothScroll();
|
||||||
|
@ -181,8 +181,8 @@
|
||||||
amountToScroll -= (scrollAmount = round(amountToScroll * 0.5));
|
amountToScroll -= (scrollAmount = round(amountToScroll * 0.5));
|
||||||
scrollAmounts.push(scrollAmount);
|
scrollAmounts.push(scrollAmount);
|
||||||
}
|
}
|
||||||
this._smoothScrollTimer = setInterval(processFrame, 60, this);
|
this._smoothScrollTimer = setInterval(processFrame, 60, this, scrollAmounts);
|
||||||
processFrame(this);
|
processFrame(this, scrollAmounts);
|
||||||
]]></body>
|
]]></body>
|
||||||
</method>
|
</method>
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче