Add Ctrl for additive selection in rubberband

This commit is contained in:
Wojtek Figat
2024-02-19 19:12:53 +01:00
parent d1f0a52967
commit ec0849c908

View File

@@ -616,6 +616,7 @@ namespace FlaxEditor.Content.GUI
{
if (base.OnMouseDown(location, button))
return true;
if (button == MouseButton.Left)
{
_mousePresslocation = location;
@@ -634,6 +635,7 @@ namespace FlaxEditor.Content.GUI
_rubberBandRectangle.Width = location.X - _mousePresslocation.X;
_rubberBandRectangle.Height = location.Y - _mousePresslocation.Y;
}
base.OnMouseMove(location);
}
@@ -655,9 +657,10 @@ namespace FlaxEditor.Content.GUI
_rubberBandRectangle.Size = size;
}
var itemsInRectangle = _items.Where(t => _rubberBandRectangle.Intersects(t.Bounds)).ToList();
Select(itemsInRectangle, Input.GetKey(KeyboardKeys.Shift));
Select(itemsInRectangle, Input.GetKey(KeyboardKeys.Shift) || Input.GetKey(KeyboardKeys.Control));
return true;
}
return base.OnMouseUp(location, button);
}