-
I'm trying to create a simple canvas paint program. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The function you're looking for is probably this one in web-sys: https://docs.rs/web-sys/latest/web_sys/struct.Element.html#method.get_bounding_client_rect Note that you need to have a web-sys dependency with the DomRect feature enabled; web-sys feature gates most APIs for compile time benefits. |
Beta Was this translation helpful? Give feedback.
The function you're looking for is probably this one in web-sys: https://docs.rs/web-sys/latest/web_sys/struct.Element.html#method.get_bounding_client_rect
Note that you need to have a web-sys dependency with the DomRect feature enabled; web-sys feature gates most APIs for compile time benefits.