Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace mover tool by selector tool #193

Merged
merged 8 commits into from
May 24, 2021
Merged

Replace mover tool by selector tool #193

merged 8 commits into from
May 24, 2021

Conversation

sents
Copy link
Contributor

@sents sents commented May 21, 2021

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 handleMessage because 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.

Copy link
Owner

@lovasoa lovasoa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

client-data/tools/hand/hand.js Outdated Show resolved Hide resolved
Copy link
Owner

@lovasoa lovasoa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

@sents sents left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your changes look good to me and everything works when I test it.

@lovasoa lovasoa merged commit 9127340 into lovasoa:master May 24, 2021
@lovasoa
Copy link
Owner

lovasoa commented May 24, 2021

It's live on https://wbo.ophir.dev 👍

@sents sents mentioned this pull request Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants