fix auto move new comment to back

This commit is contained in:
Saas
2026-03-08 23:29:20 +01:00
parent 2c8ade4288
commit 20bfc209c5
+5 -4
View File
@@ -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);