diff --git a/src/Tools/tim_tool/ui/tab/main-tab.slint b/src/Tools/tim_tool/ui/tab/main-tab.slint index 5ae87712..b6c47e05 100644 --- a/src/Tools/tim_tool/ui/tab/main-tab.slint +++ b/src/Tools/tim_tool/ui/tab/main-tab.slint @@ -121,10 +121,20 @@ export component MainTab inherits Rectangle { } function update_viewport() { + // If this value is positive, then the image moved so much to the right, that we do not use the full display area anymore + if self.viewport-x > 0 { + self.viewport-x = 0; + } + if abs(self.viewport-x) + self.width > self.viewport-width { self.viewport-x += (self.width + abs(self.viewport-x)) - self.viewport-width; } + if self.viewport-y > 0 { + self.viewport-y = 0; + } + + // If this value is positive, then the image moved so much down, that we do not use the full display area anymore if abs(self.viewport-y) + self.height > self.viewport-height { self.viewport-y += (self.height + abs(self.viewport-y)) - self.viewport-height; }