mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 04:53:29 +01:00
fixed a potential stack overflow introduced by 237334b
This commit is contained in:
parent
7bf22fa8f3
commit
a119db553f
2 changed files with 3 additions and 9 deletions
|
@ -66,12 +66,6 @@ namespace MLEM.Ui.Elements {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void OnChildAreaDirty(Element child, bool grandchild) {
|
|
||||||
if (child != this.Panel)
|
|
||||||
base.OnChildAreaDirty(child, grandchild);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds an element to this dropdown's <see cref="Panel"/>
|
/// Adds an element to this dropdown's <see cref="Panel"/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -278,10 +278,10 @@ namespace MLEM.Ui.Elements {
|
||||||
|
|
||||||
// update child padding based on whether the scroll bar is visible
|
// update child padding based on whether the scroll bar is visible
|
||||||
var childOffset = this.ScrollBar.IsHidden ? 0 : this.ScrollerSize.Value.X + this.ScrollBarOffset;
|
var childOffset = this.ScrollBar.IsHidden ? 0 : this.ScrollerSize.Value.X + this.ScrollBarOffset;
|
||||||
if (!this.scrollBarChildOffset.Equals(childOffset, Element.Epsilon)) {
|
var childOffsetDelta = childOffset - this.scrollBarChildOffset;
|
||||||
// this implicitly sets our area dirty!
|
if (!childOffsetDelta.Equals(0, Element.Epsilon)) {
|
||||||
this.ChildPadding += new Padding(0, -this.scrollBarChildOffset + childOffset, 0, 0);
|
|
||||||
this.scrollBarChildOffset = childOffset;
|
this.scrollBarChildOffset = childOffset;
|
||||||
|
this.ChildPadding += new Padding(0, childOffsetDelta, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// the scroller height has the same relation to the scroll bar height as the visible area has to the total height of the panel's content
|
// the scroller height has the same relation to the scroll bar height as the visible area has to the total height of the panel's content
|
||||||
|
|
Loading…
Reference in a new issue