From f6c4d83775af5ee2a378798b3328e678af73d1d3 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 5 Nov 2020 01:16:01 +0100 Subject: [PATCH] fixed panel element detection being incorrect if scrolling overflow is enabled --- 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 0868887..4abaabd 100644 --- a/MLEM.Ui/Elements/Panel.cs +++ b/MLEM.Ui/Elements/Panel.cs @@ -178,7 +178,7 @@ namespace MLEM.Ui.Elements { public override Element GetElementUnderPos(Vector2 position) { // if overflow is handled, don't propagate mouse checks to hidden children if (this.scrollOverflow && !this.GetRenderTargetArea().Contains(position)) - return null; + return !this.IsHidden && this.CanBeMoused && this.DisplayArea.Contains(position) ? this : null; return base.GetElementUnderPos(position); }