You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Stateful Layouter only performs a single iteration of layouting. In its current implementation, the layouting process is as follows:
First Pass: Goes bottom-up, calculating from children to parent.
Second Pass: Goes top-down, applying layout changes from parent to children.
However, the second pass does not account for the fact that some children need multiple iterations to properly reflect the updated sizes from their parents. This causes incorrect width and height calculations in complex layouts.
// Second pass: apply layout with initial size data for all// nodes. Update the position/size of all elements, taking// vGrab/hGrab into account (parent -> children).while(this.toBeLayouted2.length>0){constelement=this.toBeLayouted2[0];this.doLayout(element);}
First Pass (Bottom-Up): Initializes sizes for each component starting from Label up to Node.
Second Pass (Top-Down): Adjusts sizes starting from Node, but only propagates the size adjustments for one iteration, resulting in an incomplete layout.
Iteration Results
The issue can be demonstrated with the following iteration table:
The Stateful Layouter only performs a single iteration of layouting. In its current implementation, the layouting process is as follows:
However, the second pass does not account for the fact that some children need multiple iterations to properly reflect the updated sizes from their parents. This causes incorrect width and height calculations in complex layouts.
Problematic Code
https://github.com/eclipse-glsp/glsp-client/blob/master/packages/client/src/features/bounds/layouter.ts#L96-L118
Example Structure
Assume the following structure:
Label
up toNode
.Node
, but only propagates the size adjustments for one iteration, resulting in an incomplete layout.Iteration Results
The issue can be demonstrated with the following iteration table:
Node: 100 - Component1: 70 -- Component2: 50 --- Component3: 30 ---- Label: 20
Node: 100 - Component1: 100 -- Component2: 70 --- Component3: 50 ---- Label: 30
Node: 100 - Component1: 100 -- Component2: 100 --- Component3: 70 ---- Label: 50
Steps to Reproduce
vGrab
/hGrab
) properties to the components.The text was updated successfully, but these errors were encountered: