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

Account for scaling when computing element dimensions #27

Open
niklasramo opened this issue Jun 5, 2024 · 0 comments
Open

Account for scaling when computing element dimensions #27

niklasramo opened this issue Jun 5, 2024 · 0 comments

Comments

@niklasramo
Copy link
Owner

niklasramo commented Jun 5, 2024

All the methods that need to use getComputedStyle(el) are not working as expected when the element is scaled (e.g. transform: scale(0.5)). This is because the getComputedStyle(el) doesn't account for scaling unlike getBoundingClientRect().

In practise we need a way to compute scaled paddings, borders, margins and scrollbar size. Since doing that computation might potentially cause quite a lot of extra work maybe it's better to add an option to query the dimensions which accounts for transforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant