From 50f5f0acd9c8cc38b09ffa9383db993bbdb60d34 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Wed, 8 May 2024 20:14:46 +0300 Subject: [PATCH] Fix TreeNode rendering issues with expanded nodes --- Source/Editor/GUI/Tree/TreeNode.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Editor/GUI/Tree/TreeNode.cs b/Source/Editor/GUI/Tree/TreeNode.cs index d5782c10f..f4ff33e8d 100644 --- a/Source/Editor/GUI/Tree/TreeNode.cs +++ b/Source/Editor/GUI/Tree/TreeNode.cs @@ -729,7 +729,7 @@ namespace FlaxEditor.GUI.Tree // Try to estimate the rough location of the first node, assuming the node height is constant var firstChildGlobalRect = GetChildGlobalRectangle(children[0], ref globalTransform); - var firstVisibleChild = Math.Clamp((int)Math.Floor((globalClipping.Y - firstChildGlobalRect.Top) / firstChildGlobalRect.Height) + 1, 0, children.Count - 1); + var firstVisibleChild = Math.Clamp((int)Math.Floor((globalClipping.Y - firstChildGlobalRect.Top) / _headerHeight) + 1, 0, children.Count - 1); if (GetChildGlobalRectangle(children[firstVisibleChild], ref globalTransform).Top > globalClipping.Top || !children[firstVisibleChild].Visible) { // Estimate overshoot, either it's partially visible or hidden in the tree