Missing change for 05d477d6c8

This commit is contained in:
Wojtek Figat
2023-08-04 13:10:36 +02:00
parent 05d477d6c8
commit 73bbe63c1e
2 changed files with 18 additions and 8 deletions

View File

@@ -115,15 +115,23 @@ namespace FlaxEditor.Surface
var p1 = _rootControl.PointFromParent(ref _leftMouseDownPos);
var p2 = _rootControl.PointFromParent(ref _mousePos);
var selectionRect = Rectangle.FromPoints(p1, p2);
var selectionChanged = false;
// Find controls to select
for (int i = 0; i < _rootControl.Children.Count; i++)
{
if (_rootControl.Children[i] is SurfaceControl control)
{
control.IsSelected = control.IsSelectionIntersecting(ref selectionRect);
var select = control.IsSelectionIntersecting(ref selectionRect);
if (select != control.IsSelected)
{
control.IsSelected = select;
selectionChanged = true;
}
}
}
if (selectionChanged)
SelectionChanged?.Invoke();
}
private void OnSurfaceControlSpawned(SurfaceControl control)