Short question: How does CSS zoom work?

I need to figure out the new width & height of an element. And as getBoundingClientRect() doesn't compute the zoom (or well - it does, in a very buggy way: 1000px width with 50% zoom results in 999.34565px or so...) so I need to calc it by hand. So does zoom take the diagonal of an element and I need to go with Pythagoras (never expected to really use it in my life :D) to get the new width and height? Because this:
const zoom = this.zoom / 100;
// On zoom table.height makes some weird stuff in 0.*** pixels less
const maxHeight = (Math.ceil(table.height) - container.offsetHeight) * -zoom;
const zoom = this.zoom / 100;
// On zoom table.height makes some weird stuff in 0.*** pixels less
const maxHeight = (Math.ceil(table.height) - container.offsetHeight) * -zoom;
doesn't work (just for 100%). PS. I need it for getting the move height and width for not running out of the content)
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server