1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-06-28 15:29:10 +02:00

Fixed scroll bars doing unnecessary calculations when hidden

This commit is contained in:
Ell 2024-06-02 13:26:20 +02:00
parent 8fdc3546c6
commit d7cda0d39b
2 changed files with 63 additions and 55 deletions

View file

@ -35,6 +35,7 @@ Improvements
Fixes
- Fixed hidden scroll bars inhibiting scrolling on their parent panel
- Fixed scroll bars doing unnecessary calculations when hidden
## 6.3.1

View file

@ -145,6 +145,7 @@ namespace MLEM.Ui.Elements {
public override void Update(GameTime time) {
base.Update(time);
if (!this.IsHidden) {
// MOUSE INPUT
var moused = this.Controls.MousedElement;
var wasMouseUp = this.Input.WasUp(MouseButton.Left);
@ -205,6 +206,12 @@ namespace MLEM.Ui.Elements {
this.ScrollToPos(pos);
}
}
} else {
this.isMouseScrolling = false;
this.isMouseDragging = false;
this.isTouchScrolling = false;
this.isTouchDragging = false;
}
if (this.SmoothScrolling && this.scrollAdded != 0) {
this.scrollAdded *= this.SmoothScrollFactor;