mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 12:58:33 +01:00
Fixed scroll bars doing unnecessary calculations when hidden
This commit is contained in:
parent
8fdc3546c6
commit
d7cda0d39b
2 changed files with 63 additions and 55 deletions
|
@ -35,6 +35,7 @@ Improvements
|
||||||
|
|
||||||
Fixes
|
Fixes
|
||||||
- Fixed hidden scroll bars inhibiting scrolling on their parent panel
|
- Fixed hidden scroll bars inhibiting scrolling on their parent panel
|
||||||
|
- Fixed scroll bars doing unnecessary calculations when hidden
|
||||||
|
|
||||||
## 6.3.1
|
## 6.3.1
|
||||||
|
|
||||||
|
|
|
@ -145,6 +145,7 @@ namespace MLEM.Ui.Elements {
|
||||||
public override void Update(GameTime time) {
|
public override void Update(GameTime time) {
|
||||||
base.Update(time);
|
base.Update(time);
|
||||||
|
|
||||||
|
if (!this.IsHidden) {
|
||||||
// MOUSE INPUT
|
// MOUSE INPUT
|
||||||
var moused = this.Controls.MousedElement;
|
var moused = this.Controls.MousedElement;
|
||||||
var wasMouseUp = this.Input.WasUp(MouseButton.Left);
|
var wasMouseUp = this.Input.WasUp(MouseButton.Left);
|
||||||
|
@ -205,6 +206,12 @@ namespace MLEM.Ui.Elements {
|
||||||
this.ScrollToPos(pos);
|
this.ScrollToPos(pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.isMouseScrolling = false;
|
||||||
|
this.isMouseDragging = false;
|
||||||
|
this.isTouchScrolling = false;
|
||||||
|
this.isTouchDragging = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.SmoothScrolling && this.scrollAdded != 0) {
|
if (this.SmoothScrolling && this.scrollAdded != 0) {
|
||||||
this.scrollAdded *= this.SmoothScrollFactor;
|
this.scrollAdded *= this.SmoothScrollFactor;
|
||||||
|
|
Loading…
Reference in a new issue