From cd32372994270337b8a43d8297873c5d475235f7 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 10 Mar 2022 18:39:35 +0100 Subject: [PATCH] fixed https://github.com/Ellpeck/MLEM/commit/0f4e67f20f9f6196b746b1b6e55ad22a4c110b38 --- MLEM.Ui/Elements/Panel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MLEM.Ui/Elements/Panel.cs b/MLEM.Ui/Elements/Panel.cs index 072fb44..f452fc1 100644 --- a/MLEM.Ui/Elements/Panel.cs +++ b/MLEM.Ui/Elements/Panel.cs @@ -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); }