-
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 1 reply
-
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_space
is the size of the "containing block" (roughly, the parent node) (closely related to theparent_size
, but sometimes theavailable_space
is set toMinContent
orMaxContent
as 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_dimensions
are the size of the node itself. And indeed, if theknown_dimension
in a particular axis is set then you can generally (always I think) ignore theavailable_space
in that axis. The purpose ofknown_dimensions
is to allow the algorithm to ask "If your size in this…