mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 04:53:29 +01:00
Fixed panels updating their relevant children too much when the scroll bar is hidden
This commit is contained in:
parent
41a1a8aef1
commit
6c07a7e900
2 changed files with 4 additions and 1 deletions
|
@ -32,6 +32,9 @@ Improvements
|
||||||
- Allow scrolling panels to contain other scrolling panels
|
- Allow scrolling panels to contain other scrolling panels
|
||||||
- Allow dropdowns to have scrolling panels
|
- Allow dropdowns to have scrolling panels
|
||||||
|
|
||||||
|
Fixes
|
||||||
|
- Fixed panels updating their relevant children too much when the scroll bar is hidden
|
||||||
|
|
||||||
### MLEM.Data
|
### MLEM.Data
|
||||||
Fixes
|
Fixes
|
||||||
- Fixed various exception types not being wrapped by ContentLoadExceptions when loading raw or JSON content
|
- Fixed various exception types not being wrapped by ContentLoadExceptions when loading raw or JSON content
|
||||||
|
|
|
@ -271,7 +271,7 @@ namespace MLEM.Ui.Elements {
|
||||||
}
|
}
|
||||||
|
|
||||||
// the max value of the scroll bar is the amount of non-scaled pixels taken up by overflowing components
|
// the max value of the scroll bar is the amount of non-scaled pixels taken up by overflowing components
|
||||||
var scrollBarMax = (childrenHeight - this.ChildPaddedArea.Height) / this.Scale;
|
var scrollBarMax = Math.Max(0, (childrenHeight - this.ChildPaddedArea.Height) / this.Scale);
|
||||||
if (!this.ScrollBar.MaxValue.Equals(scrollBarMax, Element.Epsilon)) {
|
if (!this.ScrollBar.MaxValue.Equals(scrollBarMax, Element.Epsilon)) {
|
||||||
this.ScrollBar.MaxValue = scrollBarMax;
|
this.ScrollBar.MaxValue = scrollBarMax;
|
||||||
this.relevantChildrenDirty = true;
|
this.relevantChildrenDirty = true;
|
||||||
|
|
Loading…
Reference in a new issue