so1ve / vue-skinview3d

Three.js powered Minecraft skin viewer. (Vue binding of skinview3d)
https://vue-skinview3d.mk1.io
MIT License
11 stars 2 forks source link

fix: skinRef's height increase when resize #12

Closed starNGC2237 closed 1 year ago

starNGC2237 commented 1 year ago

当选择宽UI时,窗口发生resize,skinRef的高度会增长,发现如果在父高度为auto(未设置的情况下),设置的百分比不起效,将设置他的父元素设置为绝对定位,从而使百分比起效

stackblitz[bot] commented 1 year ago

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

starNGC2237 commented 1 year ago

但是我搞不懂一件事情:为什么当页面resize,skinRef的宽高会增长(笑),设置的百分比不起效是因为如果包含块(即父元素)的高度没有显式指定(即高度由内容决定),并且该元素不是绝对定位,则计算值为auto,auto *100/100 = NaN

so1ve commented 1 year ago

乐(