Improve scrolling slightly

This commit is contained in:
Jaby 2025-03-11 20:35:11 +01:00
parent 3549c1a709
commit a0368c1e51
1 changed files with 2 additions and 2 deletions

View File

@ -112,11 +112,11 @@ export component MainTab inherits Rectangle {
function update_viewport() {
if abs(self.viewport-x) + self.width > self.viewport-width {
self.viewport-x = 0;
self.viewport-x += (self.width + abs(self.viewport-x)) - self.viewport-width;
}
if abs(self.viewport-y) + self.height > self.viewport-height {
self.viewport-y = 0;
self.viewport-y += (self.height + abs(self.viewport-y)) - self.viewport-height;
}
}
}