Skip to content

Commit

Permalink
Fix containers at (0, 0) being selected when double clicking on the c…
Browse files Browse the repository at this point in the history
…anvas
  • Loading branch information
miroiu committed Jul 19, 2024
1 parent f753dd6 commit 7e40484
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Nodify/Helpers/SelectionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,16 @@ private void PreviewSelectArea(Rect area, bool append = false, bool fit = false)
PreviewUnselectAll();
}

ItemCollection items = _host.Items;
for (var i = 0; i < items.Count; i++)
if (area.X != 0 || area.Y != 0 || area.Width > 0 || area.Height > 0)
{
var container = (ItemContainer)_host.ItemContainerGenerator.ContainerFromIndex(i);
if (container.IsSelectableInArea(area, fit))
ItemCollection items = _host.Items;
for (var i = 0; i < items.Count; i++)
{
container.IsPreviewingSelection = true;
var container = (ItemContainer)_host.ItemContainerGenerator.ContainerFromIndex(i);
if (container.IsSelectableInArea(area, fit))
{
container.IsPreviewingSelection = true;
}
}
}
}
Expand Down

0 comments on commit 7e40484

Please sign in to comment.