TermIO scroll fix

This commit is contained in:
Djeeberjr 2022-02-28 20:57:40 +01:00
parent c96d06653a
commit d4703fb725

View File

@ -22,6 +22,11 @@ class TermIO {
}
var size = output.getSize();
var cPos = output.getCursorPos();
if (cPos.y >= size.y){
newLine();
}
for (i in 0...Math.floor(text.length / size.x) + 1) {
output.write(text.substr(i * size.x, size.x));
@ -38,7 +43,7 @@ class TermIO {
if (cPos.y == output.getSize().y) {
output.scroll(1);
output.setCursorPos(0, cPos.y);
output.setCursorPos(0, cPos.y - 1);
} else {
output.setCursorPos(0, cPos.y + 1);
}