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

Fix the transparent SVG issue related to Drag to Select #56

Open
1 task done
HollowMan6 opened this issue Jun 12, 2024 · 1 comment
Open
1 task done

Fix the transparent SVG issue related to Drag to Select #56

HollowMan6 opened this issue Jun 12, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@HollowMan6
Copy link
Collaborator

Check for duplicates

  • I have searched for similar issues before opening a new one.

Description

Currently, we rely on DragSelect to know which block gets selected. DragSelect seems to listen to the "blocks". However, it actually works by listening to the SVG path element, which is always a rectangle with some transparent parts forming a block. For irregularly shaped blocks, if you click on the transparent area that within the SVG rectangle, it will still get selected. (a mitigation has already been introduced in v0.1.4.)

Reproduction steps

See #6 (comment)

Stack trace

No response

Screenshots

No response

Browsers

No response

@HollowMan6 HollowMan6 added the bug Something isn't working label Jun 12, 2024
@HollowMan6
Copy link
Collaborator Author

HollowMan6 commented Jun 12, 2024

After the discussion with the Blockly team, one possible way is to temporarily turn the SVG group into a canvas when the coordinates fall into the bounding box of those blockSVGs. Then we can convert coordinates and check the color of those coordinates to see if we are touching the transparent part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant