diff --git a/Source/Editor/GUI/Tree/TreeNode.cs b/Source/Editor/GUI/Tree/TreeNode.cs index 7b94f7f30..9bb9d2038 100644 --- a/Source/Editor/GUI/Tree/TreeNode.cs +++ b/Source/Editor/GUI/Tree/TreeNode.cs @@ -698,7 +698,7 @@ namespace FlaxEditor.GUI.Tree } } - // Show tree guide lines + // Show tree guidelines if (Editor.Instance.Options.Options.Interface.ShowTreeLines) { TreeNode parentNode = Parent as TreeNode; @@ -753,15 +753,16 @@ namespace FlaxEditor.GUI.Tree var children = _children; if (children.Count == 0) return; + var last = children.Count - 1; if (CullChildren) { Render2D.PeekClip(out var globalClipping); Render2D.PeekTransform(out var globalTransform); - // Try to estimate the rough location of the first node, assuming the node height is constant + // Try to estimate the rough location of the first and the last nodes, assuming the node height is constant var firstChildGlobalRect = GetChildGlobalRectangle(children[0], ref globalTransform); - var firstVisibleChild = Math.Clamp((int)Math.Floor((globalClipping.Y - firstChildGlobalRect.Top) / _headerHeight) + 1, 0, children.Count - 1); + var firstVisibleChild = Math.Clamp((int)Math.Floor((globalClipping.Top - firstChildGlobalRect.Top) / _headerHeight) + 1, 0, last); if (GetChildGlobalRectangle(children[firstVisibleChild], ref globalTransform).Top > globalClipping.Top || !children[firstVisibleChild].Visible) { // Estimate overshoot, either it's partially visible or hidden in the tree @@ -770,22 +771,29 @@ namespace FlaxEditor.GUI.Tree var child = children[firstVisibleChild]; if (!child.Visible) continue; - if (GetChildGlobalRectangle(child, ref globalTransform).Top < globalClipping.Top) break; } } + var lastVisibleChild = Math.Clamp((int)Math.Ceiling((globalClipping.Bottom - firstChildGlobalRect.Top) / _headerHeight) + 1, firstVisibleChild, last); + if (GetChildGlobalRectangle(children[lastVisibleChild], ref globalTransform).Top < globalClipping.Bottom || !children[lastVisibleChild].Visible) + { + // Estimate overshoot, either it's partially visible or hidden in the tree + for (; lastVisibleChild < last; lastVisibleChild++) + { + var child = children[lastVisibleChild]; + if (!child.Visible) + continue; + if (GetChildGlobalRectangle(child, ref globalTransform).Top > globalClipping.Bottom) + break; + } + } - for (int i = firstVisibleChild; i < children.Count; i++) + for (int i = firstVisibleChild; i <= lastVisibleChild; i++) { var child = children[i]; if (!child.Visible) continue; - - var childGlobalRect = GetChildGlobalRectangle(child, ref globalTransform); - if (!globalClipping.Intersects(ref childGlobalRect)) - break; - Render2D.PushTransform(ref child._cachedTransform); child.Draw(); Render2D.PopTransform(); @@ -799,7 +807,7 @@ namespace FlaxEditor.GUI.Tree } else { - for (int i = 0; i < children.Count; i++) + for (int i = 0; i <= last; i++) { var child = children[i]; if (child.Visible) diff --git a/Source/Editor/Surface/ContextMenu/VisjectCMGroup.cs b/Source/Editor/Surface/ContextMenu/VisjectCMGroup.cs index d8cf0433f..d794d1642 100644 --- a/Source/Editor/Surface/ContextMenu/VisjectCMGroup.cs +++ b/Source/Editor/Surface/ContextMenu/VisjectCMGroup.cs @@ -96,15 +96,20 @@ namespace FlaxEditor.Surface.ContextMenu int dotIndex = filterText.IndexOf('.'); if (dotIndex != -1) { - // Early out and make the group invisible if it doesn't start with the specified string string filterGroupName = filterText.Substring(0, dotIndex); - if (!Name.StartsWith(filterGroupName, StringComparison.InvariantCultureIgnoreCase)) + + // If the string in front of the dot has the length of 0 or doesn't start with a letter we skip the filtering to make spawning floats work + if (filterGroupName.Length > 0 && char.IsLetter(filterGroupName[0])) { - Visible = false; - Profiler.EndEvent(); - return; + // Early out and make the group invisible if it doesn't start with the specified string + if (!Name.StartsWith(filterGroupName, StringComparison.InvariantCultureIgnoreCase)) + { + Visible = false; + Profiler.EndEvent(); + return; + } + filterText = filterText.Substring(dotIndex + 1); } - filterText = filterText.Substring(dotIndex + 1); } } diff --git a/Source/Engine/GraphicsDevice/Vulkan/DescriptorSetVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/DescriptorSetVulkan.cpp index 09404362d..44cb75705 100644 --- a/Source/Engine/GraphicsDevice/Vulkan/DescriptorSetVulkan.cpp +++ b/Source/Engine/GraphicsDevice/Vulkan/DescriptorSetVulkan.cpp @@ -292,7 +292,7 @@ DescriptorPoolSetContainerVulkan* DescriptorPoolsManagerVulkan::AcquirePoolSetCo ScopeLock lock(_locker); for (auto* poolSet : _poolSets) { - if (poolSet->Refs == 0) + if (poolSet->Refs == 0 && Engine::FrameCount - poolSet->LastFrameUsed > VULKAN_RESOURCE_DELETE_SAFE_FRAMES_COUNT) { poolSet->LastFrameUsed = Engine::FrameCount; poolSet->Reset(); diff --git a/Source/Engine/Physics/Actors/WheeledVehicle.cpp b/Source/Engine/Physics/Actors/WheeledVehicle.cpp index d9eb12e2f..11157783e 100644 --- a/Source/Engine/Physics/Actors/WheeledVehicle.cpp +++ b/Source/Engine/Physics/Actors/WheeledVehicle.cpp @@ -67,8 +67,9 @@ void WheeledVehicle::SetDriveControl(DriveControlSettings value) for (int32 i = 0; i < steerVsSpeedCount; i++) { // Apply only on changed value - if (Math::NotNearEqual(_driveControl.SteerVsSpeed[i].Speed, value.SteerVsSpeed[i].Speed) || - Math::NotNearEqual(_driveControl.SteerVsSpeed[i].Steer, value.SteerVsSpeed[i].Steer)) + if (i > _driveControl.SteerVsSpeed.Count() - 1 || + Math::NotNearEqual(_driveControl.SteerVsSpeed[i].Speed, value.SteerVsSpeed[i].Speed) || + Math::NotNearEqual(_driveControl.SteerVsSpeed[i].Steer, value.SteerVsSpeed[i].Steer)) { SteerControl& steerVsSpeed = value.SteerVsSpeed[i]; steerVsSpeed.Steer = Math::Saturate(steerVsSpeed.Steer); diff --git a/Source/Engine/Render2D/Render2D.cpp b/Source/Engine/Render2D/Render2D.cpp index c65a9f401..84de6666d 100644 --- a/Source/Engine/Render2D/Render2D.cpp +++ b/Source/Engine/Render2D/Render2D.cpp @@ -265,7 +265,7 @@ FORCE_INLINE Render2DVertex MakeVertex(const Float2& point, const Float2& uv, co { point, Half2(uv), - color, + color * TintLayersStack.Peek(), customData, mask, };