未验证 提交 bb25313b 编写于 作者: G GitSquared

🐛 Fix #302

上级 f85334ca
......@@ -161,8 +161,23 @@ class Terminal {
this.fit = () => {
this.term.fit();
// Apply custom fixes based on screen ratio, see #302
let w = screen.width;
let h = screen.height;
let x = 1;
let y = 0;
function gcd(a, b) {
return (b == 0) ? a : gcd(b, a%b);
}
let d = gcd(w, h);
let ratio = `${w/d}:${h/d}`;
if (ratio === "16:9") y = 1;
setTimeout(() => {
this.resize(this.term.cols+1, this.term.rows+1);
this.resize(this.term.cols+x, this.term.rows+y);
}, 50);
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册