TIM-Tool: Fix scroll bug when centering #25
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue