1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-22 20:58:34 +01:00
This commit is contained in:
Ell 2022-03-10 18:39:35 +01:00
parent 0f4e67f20f
commit cd32372994

View file

@ -85,7 +85,7 @@ namespace MLEM.Ui.Elements {
if (e == null || !e.GetParentTree().Contains(this))
return;
var firstChild = this.Children.First(c => c != this.ScrollBar);
this.ScrollBar.CurrentValue = (e.UnscrolledArea.Center.Y - firstChild.Area.Height - this.Area.Height / 2) / e.Scale + this.ChildPadding.Value.Height;
this.ScrollBar.CurrentValue = (e.Area.Center.Y - this.Area.Height / 2 - firstChild.Area.Top) / e.Scale + this.ChildPadding.Value.Height / 2;
};
this.AddChild(this.ScrollBar);
}