diff --git a/Source/Editor/Surface/VisjectSurface.cs b/Source/Editor/Surface/VisjectSurface.cs index e3bb94bcc..69c44ab98 100644 --- a/Source/Editor/Surface/VisjectSurface.cs +++ b/Source/Editor/Surface/VisjectSurface.cs @@ -810,10 +810,11 @@ namespace FlaxEditor.Surface int lowestCommentOrder = int.MaxValue; for (int i = 0; i < selection.Count; i++) { - if (selection[i] is not SurfaceComment || selection[i].IndexInParent >= lowestCommentOrder) - continue; - hasCommentsSelected = true; - lowestCommentOrder = selection[i].IndexInParent; + if (selection[i] is ResizableSurfaceNode node && node is SurfaceComment && node.ResizeBorderControl.IndexInParent < lowestCommentOrder) + { + hasCommentsSelected = true; + lowestCommentOrder = node.ResizeBorderControl.IndexInParent; + } } return _context.CreateComment(ref surfaceArea, string.IsNullOrEmpty(text) ? "Comment" : text, new Color(1.0f, 1.0f, 1.0f, 0.2f), hasCommentsSelected ? lowestCommentOrder : -1);