Replace mover tool by selector tool#193
Merged
lovasoa merged 8 commits intolovasoa:masterfrom May 24, 2021
Merged
Conversation
lovasoa
requested changes
May 21, 2021
Owner
lovasoa
left a comment
There was a problem hiding this comment.
Hello and thank you very much for your contribution ! Selection would be a great feature to have ! But unfortunately, you would need to find a way to let the browser's engine compute the selected elements list. Otherwise, this will not scale beyond very small boards.
lovasoa
approved these changes
May 23, 2021
Owner
lovasoa
left a comment
There was a problem hiding this comment.
Ok, I tested the changes, and made a few small changes. I am happy with how things are now. If you validate my changes, I'm ready to merge.
sents
commented
May 24, 2021
Contributor
Author
sents
left a comment
There was a problem hiding this comment.
Your changes look good to me and everything works when I test it.
Owner
|
It's live on https://wbo.ophir.dev 👍 |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR replaces the mover tool (secondary for hand) with a selector tool. It enables the user to draw a box around
elements and move all the elements in the box together. Additionaly the old way of dragging elements by clicking directly on them
also works.
The PR checks if the bounding boxes of the elements are contained in the selection box. Because SVGElement.getBBox() does not include transformations I've added the necessary calculations in
client_data/js/intersect.js. I am not sure if selection by intersecting bounding boxes would feel better but I am working to implement that too to test it out.Eventually it would be awesome if we could define shortcuts to act on the selection for copy/paste/cut but I haven't looked into that yet.
On the server side this adds handling batch messages going client->server, which until now only went server->client.
For now it simply duplicates the
handleMessagebecause I didn't want to change the server code so much.The selector tool works well with #124.
Thank you for making this awesome tool!
By opening a pull request, I certify that I hold the intellectual property of the code I am submitting,
and I am granting the initial authors of WBO a perpetual, worldwide, non-exclusive, royalty-free, and irrevocable license to this code.