mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-14 04:48:40 -09:00
avoid layout recalculation upon scrollport resize
This commit is contained in:
parent
ade9ad39fd
commit
361db6190e
1 changed files with 19 additions and 0 deletions
19
lib/hterm.js
19
lib/hterm.js
|
|
@ -324,6 +324,25 @@ hterm.Terminal.prototype.onMouseDown_ = function (e) {
|
|||
}
|
||||
};
|
||||
|
||||
// override `ScrollPort.resize` to avoid an expensive calculation
|
||||
// just to get the size of the scrollbar, which for Hyper is always
|
||||
// set to overlay (hence with `0`)
|
||||
hterm.ScrollPort.prototype.resize = function () {
|
||||
this.currentScrollbarWidthPx = 0;
|
||||
|
||||
this.syncScrollHeight();
|
||||
this.syncRowNodesDimensions_();
|
||||
|
||||
this.publish(
|
||||
'resize',
|
||||
{scrollPort: this},
|
||||
() => {
|
||||
this.scrollRowToBottom(this.rowProvider_.getRowCount());
|
||||
this.scheduleRedraw();
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
// make background transparent to avoid transparency issues
|
||||
hterm.ScrollPort.prototype.setBackgroundColor = function () {
|
||||
this.screen_.style.backgroundColor = 'transparent';
|
||||
|
|
|
|||
Loading…
Reference in a new issue