akiraux / Akira

Native Linux App for UI and UX Design built in Vala and GTK
GNU General Public License v3.0
5.24k stars 203 forks source link

Add multi selection by click and drag #684

Closed giacomoalbe closed 2 years ago

giacomoalbe commented 2 years ago
## Summary / How this PR fixes the problem?

This PR handles click and drag multi selection, both inside artboard and outside (on freeitems).

It does create a new mode and a new ViewLayer.

Inside test is performed on item's bound. This needs to be completely included inside the selection bound. Partial bound inclusion yields no selection.

Steps to Test

* Create some freeitems or some items inside an artboard * Click on an empty area on the canvas * Drag to include the items you'd like to select ## Screenshots

https://user-images.githubusercontent.com/11556031/147583828-0ba2b44c-157e-41ab-9d2d-1c9757f2d090.mp4

Known Issues / Things To Do

giacomoalbe commented 2 years ago

There's a segfault whenever I create an artboard and then select and empty area.

Ok I fixed the issue in the last commit.

One thing that would be great to have is a live indicator of which items will be included in the selection. Something like an "hover effect" around the items included in the selection area. It could be done in a follow up PR.

Yes, this would be nice. And I also think it should be done in another PR :)

This should be ready to be merged!