зеркало из 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;
|
||||
}
|
||||
|
||||
function processFrame(self) {
|
||||
function processFrame(self, scrollAmounts) {
|
||||
self.scrollBoxObject.scrollBy(scrollAmounts.shift(), 0);
|
||||
if (!scrollAmounts.length)
|
||||
self._stopSmoothScroll();
|
||||
|
@ -181,8 +181,8 @@
|
|||
amountToScroll -= (scrollAmount = round(amountToScroll * 0.5));
|
||||
scrollAmounts.push(scrollAmount);
|
||||
}
|
||||
this._smoothScrollTimer = setInterval(processFrame, 60, this);
|
||||
processFrame(this);
|
||||
this._smoothScrollTimer = setInterval(processFrame, 60, this, scrollAmounts);
|
||||
processFrame(this, scrollAmounts);
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче