-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Issue with mouseX and mouseY when using a CSS border #7400
Comments
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you! |
Hi @megaMcKaren , The CSS border on canvas does have this side effect; sometimes using
And in the CSS:
Tagging the DOM area stewards in case there are other solutions or actions that make sense here here @SarveshLimaye, @SoundaryaKoutharapu, @ramya202000, @BamaCharanChhandogi, @Obi-Engine10, @MarceloGoncalves, @hiddenenigma |
Currently Line 864 in 3bb2222
Updating the functionality would be a breaking change, so if someone added a border around the canvas and artificially changed I haven't looked into it much, but we could manually take into account the width of the border / padding to ensure |
i want to contribute in this. like : const correctedMouseX = mouseX - offsetX; rect(correctedMouseX, correctedMouseY, 5, 5); |
Most appropriate sub-area of p5.js?
p5.js version
1.9.4
Web browser and version
130.0.6723.117 (Official Build) (64-bit) (cohort: Stable)
Operating system
Steps to reproduce this
Steps:
Snippet:
The text was updated successfully, but these errors were encountered: