Closed 4zuko closed 6 years ago
Thanks for the issue and PR, @4zuko!
I assume we need this, as the current code assumes canvas takes up the entire screen space. With these changes, we can ensure we target the canvas size regardless of its position and size within the DOM. is that correct?
If so, this is a great addition. We should generalize this function, similar to worldToScreenSpace and include it as a helper. That way, we can use it throughout the application, as the canvas is often retrieved.
I've left my review in the PR (I assume we need this, as the current code assumes canvas takes up the entire screen space. With these changes, we can ensure we target the canvas size regardless of its position and size within the DOM. is that correct?
If so, this is a great addition. We should generalize this function, similar to worldToScreenSpace and include it as a helper. That way, we can use it throughout the application, as the canvas is often retrieved.
I've left my reviews in your PR: https://github.com/webgl/three-musketeers/pull/2
Thanks for the PR, @4zuko. It has been merged into master 👍
Hi @FarhadG. Following case didn't work as expected on my local environment. Cursor position was invalid once simulation of click event is performed:
It seems that function
getWorldPosition
doesn't work as expected. I made a quick fix that works perfectly. You can check it and test it as well: