From af633a4fdf615b0b90e399e7be083062223fd079 Mon Sep 17 00:00:00 2001 From: Jaby Date: Sat, 5 Apr 2025 22:22:33 +0200 Subject: [PATCH] Fix scoll issue --- src/Tools/tim_tool/ui/tab/main-tab.slint | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; }