-
|
I'm not entirely sure what is the difference between the two. In the cosmic_text example (
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Broadly:
TL;DR: known_dimensions takes precedence over available_space. P.S. known_dimensions is a hard constraint. If known_dimensions is set in an axis, then the output size in that axis will be ignored entirely and only the output size in the other axis used. |
Beta Was this translation helpful? Give feedback.
Broadly:
available_spaceis the size of the "containing block" (roughly, the parent node) (closely related to theparent_size, but sometimes theavailable_spaceis set toMinContentorMaxContentas part of a multi-pass layout algorithm even if the size of parent is actually known. It's best to think of available_space as a constraint that asks: "If you had this much space, then what size would you be?".known_dimensionsare the size of the node itself. And indeed, if theknown_dimensionin a particular axis is set then you can generally (always I think) ignore theavailable_spacein that axis. The purpose ofknown_dimensionsis to allow the algorithm to ask "If your size in this…