bright-gpu-74537
04/02/2023, 11:40 AM-D ABI=-MD
icy-zebra-52882
04/02/2023, 11:43 AMicy-zebra-52882
04/02/2023, 11:43 AMhttps://plzlookat.mystupid.pictures/uIQbNnfRpm.png▾
bright-gpu-74537
04/02/2023, 11:44 AMbright-gpu-74537
04/02/2023, 11:44 AMicy-zebra-52882
04/02/2023, 11:44 AMicy-zebra-52882
04/02/2023, 11:44 AMbright-gpu-74537
04/02/2023, 11:50 AMbright-gpu-74537
04/02/2023, 11:50 AMhttps://cdn.discordapp.com/attachments/565569107701923852/1092053444308783114/image.png▾
bright-gpu-74537
04/02/2023, 11:50 AMbright-gpu-74537
04/02/2023, 11:54 AMbright-gpu-74537
04/02/2023, 11:54 AMhttps://cdn.discordapp.com/attachments/565569107701923852/1092054521762558124/image.png▾
icy-zebra-52882
04/02/2023, 11:54 AMbright-gpu-74537
04/02/2023, 11:54 AMbright-gpu-74537
04/02/2023, 11:55 AMripe-apple-72114
04/02/2023, 11:58 AMicy-zebra-52882
04/02/2023, 12:00 PMripe-apple-72114
04/02/2023, 12:02 PMblue-lock-94355
04/02/2023, 12:09 PMdepth-first LRN
algorithm, for the current component it records their absolute size to State
if it has an absolute size (usually regular components with known size such as text
, button
, ...) or if it is a layout and size of the children already calculated. Then layouts (row, col, ...) (still for the current component) calculates and records children size relative to it (if child specify that their size is relative to parent). For c) there are no special case, because at the moment it will be already calculated at the previous step
So I illustrate a problem at the two examples below
In my library the first example calculated without problem, but algorithm broke for the second case, because size of the nested component (with styleNames="test3") calculated in the nested component (with styleNames="test2") but their size is unknown - its size will be calculated in outer component (with styleNames="test1"). So how do you travel through the tree to avoid this problem? Do you recalculate tree and propagate sizes to a children in multiple steps after you see relative to parent size or you do it something else?blue-lock-94355
04/02/2023, 12:09 PMhtml
<vbox style="padding:15px;width:100%;height:100%;spacing:20px;">
<style>
* {
border: 0px solid black;
padding: 0;
}
.test1 {
background-color: green;
}
.test2 {
background-color: yellow;
}
.test3 {
background-color: purple;
}
</style>
<!-- example 1 -->
<box styleNames="test1" width="100px" height="100px" >
<box styleNames="test2" width="60%">
<box styleNames="test3" width="30px" height="30px" />
</box>
</box>
<!-- example 2 -->
<box styleNames="test1" width="100px" height="100px" >
<box styleNames="test2" width="50%" height="50%">
<box styleNames="test3" width="90%" height="90%" />
</box>
</box>
</vbox>
bright-gpu-74537
04/02/2023, 12:16 PMbright-gpu-74537
04/02/2023, 12:17 PMblue-lock-94355
04/02/2023, 12:17 PMbefore
?ripe-apple-72114
04/02/2023, 12:18 PMblue-lock-94355
04/02/2023, 12:23 PMblue-lock-94355
04/02/2023, 12:24 PMbright-gpu-74537
04/02/2023, 12:33 PMhttps://cdn.discordapp.com/attachments/565569107701923852/1092064364430905434/treeview-flixel.gif▾
ripe-apple-72114
04/02/2023, 12:37 PMripe-apple-72114
04/02/2023, 12:37 PM