From c27bc9e15093d2b84e830d67c8bdd66f3e7100da Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Mon, 27 Jul 2026 20:41:43 -0500 Subject: [PATCH] Prevent crash when split panel has zero width or height --- Source/Engine/UI/GUI/Panels/SplitPanel.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Engine/UI/GUI/Panels/SplitPanel.cs b/Source/Engine/UI/GUI/Panels/SplitPanel.cs index 060459723..3daf18941 100644 --- a/Source/Engine/UI/GUI/Panels/SplitPanel.cs +++ b/Source/Engine/UI/GUI/Panels/SplitPanel.cs @@ -162,7 +162,10 @@ namespace FlaxEngine.GUI if (_splitterClicked) { - SplitterValue = _orientation == Orientation.Horizontal ? location.X / Width : location.Y / Height; + if (_orientation == Orientation.Horizontal && Width > 0) + SplitterValue = location.X / Width; + else if (_orientation == Orientation.Vertical && Height > 0) + SplitterValue = location.Y / Height; Cursor = _orientation == Orientation.Horizontal ? CursorType.SizeWE : CursorType.SizeNS; _cursorChanged = true; }