-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Val
viewport unit variants
#8137
Conversation
* Added `Val` viewport unit variants `Vw`, `Vh`, `VMin` and `VMax`. * Modified `convert` module to support the new `Val` variants. * Changed `flex_node_system` to support the new `Val` variants. * Perform full layout update on screen resizing, to propagate the new viewport size to all nodes.
Fixes DioxusLabs/taffy#239 for me 😄 |
Having to do a full re-layout on window size changes is annoying, but I don't think even a large FPS drop when resizing really matters that much. |
Well done and useful. Agreed on the relayout on window size change. I don't see any clean way around that for now, so we can wait and try something more involved if it's a problem. |
A hack I've come up with is to have a system that runs on window resize events which iterates through all |
Objective
Add viewport variants to
Val
that specify a percentage length based on the size of the window.Solution
Add the variants
Vw
,Vh
,VMin
andVMax
toVal
.Add a physical window size parameter to the
from_style
function and use it to convert the viewport variants to Taffy Points values.One issue: It isn't responsive to window resizes. So
flex_node_system
has to do a full update every time the window size changes. Perhaps this can be fixed with support from Taffy.Changelog
Val
viewport unit variantsVw
,Vh
,VMin
andVMax
.convert
module to support the newVal
variants.flex_node_system
to support the newVal
variants.