mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-12-24 17:29:23 +01:00
Fixed elements sometimes staying hidden when they shouldn't in scrolling panels
This commit is contained in:
parent
98118e540a
commit
16b9e26969
3 changed files with 10 additions and 3 deletions
|
@ -34,6 +34,7 @@ Fixes
|
|||
- Fixed auto-nav tooltip displaying on the selected element even when not in auto-nav mode
|
||||
- Fixed radio buttons not unchecking all other radio buttons with the same root element
|
||||
- Fixed elements not being deselected when removed through RemoveChild
|
||||
- Fixed elements sometimes staying hidden when they shouldn't in scrolling panels
|
||||
|
||||
Removals
|
||||
- Marked old Draw and DrawTransformed overloads as obsolete in favor of SpriteBatchContext ones
|
||||
|
|
|
@ -901,13 +901,14 @@ namespace MLEM.Ui.Elements {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates this element and all of its <see cref="GetRelevantChildren"/>
|
||||
/// Updates this element and all of its <see cref="SortedChildren"/>
|
||||
/// </summary>
|
||||
/// <param name="time">The game's time</param>
|
||||
public virtual void Update(GameTime time) {
|
||||
this.System.InvokeOnElementUpdated(this, time);
|
||||
|
||||
foreach (var child in this.GetRelevantChildren()) {
|
||||
// update all sorted children, not just relevant ones, because they might become relevant or irrelevant through updates
|
||||
foreach (var child in this.SortedChildren) {
|
||||
if (child.System != null)
|
||||
child.Update(time);
|
||||
}
|
||||
|
|
|
@ -59,8 +59,13 @@ namespace MLEM.Ui.Elements {
|
|||
set {
|
||||
if (this.text != value) {
|
||||
this.text = value;
|
||||
this.forceHide = string.IsNullOrWhiteSpace(this.text);
|
||||
this.SetTextDirty();
|
||||
|
||||
var force = string.IsNullOrWhiteSpace(this.text);
|
||||
if (this.forceHide != force) {
|
||||
this.forceHide = force;
|
||||
this.SetAreaDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue