mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
always set sw size
This commit is contained in:
+6
-2
@@ -2600,13 +2600,17 @@ class ScreenWindowView extends React.Component<{sw : ScreenWindow}, {}> {
|
||||
}
|
||||
|
||||
setSize(width : number, height : number) : void {
|
||||
let {sw} = this.props;
|
||||
if (sw == null) {
|
||||
return;
|
||||
}
|
||||
mobx.action(() => {
|
||||
this.width.set(width);
|
||||
this.height.set(height);
|
||||
let {sw} = this.props;
|
||||
let cols = windowWidthToCols(width, GlobalModel.termFontSize.get());
|
||||
let rows = windowHeightToRows(height, GlobalModel.termFontSize.get());
|
||||
if (sw == null || cols == 0 || rows == 0) {
|
||||
if (cols == 0 || rows == 0) {
|
||||
console.log("cannot set sw size", rows, cols);
|
||||
return;
|
||||
}
|
||||
sw.termSizeCallback(rows, cols);
|
||||
|
||||
@@ -484,10 +484,6 @@ class ScreenWindow {
|
||||
}
|
||||
|
||||
termSizeCallback(rows : number, cols : number) : void {
|
||||
if (!this.isActive()) {
|
||||
console.log("termSize (not active)");
|
||||
return;
|
||||
}
|
||||
if (cols == 0 || rows == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user