From 76cf935583f1f6ea3c090316155853a02a4757fb Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Wed, 10 Jan 2024 22:00:20 -0600 Subject: [PATCH] Fix `Dropdown` panel scale correctly. --- Source/Engine/UI/GUI/Common/Dropdown.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Engine/UI/GUI/Common/Dropdown.cs b/Source/Engine/UI/GUI/Common/Dropdown.cs index 31ea87948..90454b586 100644 --- a/Source/Engine/UI/GUI/Common/Dropdown.cs +++ b/Source/Engine/UI/GUI/Common/Dropdown.cs @@ -606,14 +606,15 @@ namespace FlaxEngine.GUI _popup.LostFocus += DestroyPopup; // Show dropdown popup - var locationRootSpace = Location + new Float2(0, Height); + var locationRootSpace = Location + new Float2(0, Height - Height * (1 - Scale.Y) / 2); var parent = Parent; while (parent != null && parent != root) { locationRootSpace = parent.PointToParent(ref locationRootSpace); parent = parent.Parent; } - _popup.Location = locationRootSpace; + _popup.Scale = Scale; + _popup.Location = locationRootSpace - new Float2(0, _popup.Height * (1 - _popup.Scale.Y) / 2); _popup.Parent = root; _popup.Focus(); _popup.StartMouseCapture();