-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
It would be better with element.getBoundingClientRect() #1032
Comments
Something like this I did. export interface BoundingClientRect {
bottom: number,
left: number,
right: number,
height: number,
top: number,
width: number,
x: number,
y: number
}
const rect:BoundingClientRect = elem.$el.getBoundingClientRect();
return Math.floor(
Math.sqrt(
Math.pow(pageX.value - (rect.left + rect.width / 2), 2) +
Math.pow(pageY.value - (rect.top + rect.height / 2), 2)
)
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
vue-composable/packages/vue-composable/src/dom/mouseDistanceFromElement.ts
Line 54 in 879528a
I don't have time right now to fork-fix-pull request. I will do it in 1 week from now if you want.
Awesome repository! ❤️
The text was updated successfully, but these errors were encountered: