1
0
Fork 0
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:
Ell 2023-08-14 18:32:27 +02:00
parent 7bf22fa8f3
commit a119db553f
2 changed files with 3 additions and 9 deletions

View file

@ -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>
/// Adds an element to this dropdown's <see cref="Panel"/>
/// </summary>

View file

@ -278,10 +278,10 @@ namespace MLEM.Ui.Elements {
// update child padding based on whether the scroll bar is visible
var childOffset = this.ScrollBar.IsHidden ? 0 : this.ScrollerSize.Value.X + this.ScrollBarOffset;
if (!this.scrollBarChildOffset.Equals(childOffset, Element.Epsilon)) {
// this implicitly sets our area dirty!
this.ChildPadding += new Padding(0, -this.scrollBarChildOffset + childOffset, 0, 0);
var childOffsetDelta = childOffset - this.scrollBarChildOffset;
if (!childOffsetDelta.Equals(0, Element.Epsilon)) {
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