1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-07 14:50:56 +00:00

4.0.0-rc18.2

More performance!

* Changed: Push the chat scroll to bottom into a new animation frame to avoid costly recalculations as much as possible.
* Fixed: Runaway performance issue when using FontAwesome icons for in-line chat actions due to an overabundance of CSS.
* Fixed: Emitting updated events for settings that haven't changed, resulting in frequent re-rendering of all chat lines.
This commit is contained in:
SirStendec 2019-04-30 15:18:29 -04:00
parent 918a5fbb13
commit 8bc25b8d5f
7 changed files with 182 additions and 15 deletions

View file

@ -318,14 +318,22 @@ export default class Scroller extends Module {
return;
const t = this;
this._doScroll = function() {
if ( ! t.ffz_freeze_enabled || ! t.state.ffzFrozen ) {
if ( t.ffz_smooth_scroll )
t.smoothScrollBottom();
else
t._old_scroll();
}
}
this._old_scroll = this.scrollToBottom;
this.scrollToBottom = function() {
if ( ! this.ffz_freeze_enabled || ! this.state.ffzFrozen ) {
if ( this.ffz_smooth_scroll )
this.smoothScrollBottom();
else
this._old_scroll();
}
if ( this._ffz_animation )
cancelAnimationFrame(this._ffz_animation);
this._ffz_animation = requestAnimationFrame(t._doScroll);
}
this._ffz_handleScroll = this.handleScrollEvent;