@@ -89,18 +89,25 @@ public LayoutResult layout(LayoutContext layoutContext) {
89
89
lines = FlexUtil .calculateChildrenRectangles (layoutContextRectangle , this );
90
90
final List <UnitValue > previousWidths = new ArrayList <>();
91
91
final List <UnitValue > previousHeights = new ArrayList <>();
92
+ final List <UnitValue > previousMinHeights = new ArrayList <>();
92
93
for (final List <FlexItemInfo > line : lines ) {
93
94
for (final FlexItemInfo itemInfo : line ) {
94
95
final Rectangle rectangleWithoutBordersMarginsPaddings =
95
96
itemInfo .getRenderer ().applyMarginsBordersPaddings (itemInfo .getRectangle ().clone (), false );
96
97
97
98
previousWidths .add (itemInfo .getRenderer ().<UnitValue >getProperty (Property .WIDTH ));
98
99
previousHeights .add (itemInfo .getRenderer ().<UnitValue >getProperty (Property .HEIGHT ));
100
+ previousMinHeights .add (itemInfo .getRenderer ().<UnitValue >getProperty (Property .MIN_HEIGHT ));
99
101
100
102
itemInfo .getRenderer ().setProperty (Property .WIDTH ,
101
103
UnitValue .createPointValue (rectangleWithoutBordersMarginsPaddings .getWidth ()));
102
104
itemInfo .getRenderer ().setProperty (Property .HEIGHT ,
103
105
UnitValue .createPointValue (rectangleWithoutBordersMarginsPaddings .getHeight ()));
106
+ // TODO DEVSIX-1895 Once the ticket is closed, there will be no need in setting min-height
107
+ // In case element takes less vertical space than expected, we need to make sure
108
+ // it is extended to the height predicted by the algo
109
+ itemInfo .getRenderer ().setProperty (Property .MIN_HEIGHT ,
110
+ UnitValue .createPointValue (rectangleWithoutBordersMarginsPaddings .getHeight ()));
104
111
}
105
112
}
106
113
final LayoutResult result = super .layout (layoutContext );
@@ -113,6 +120,7 @@ public LayoutResult layout(LayoutContext layoutContext) {
113
120
for (final FlexItemInfo itemInfo : line ) {
114
121
itemInfo .getRenderer ().setProperty (Property .WIDTH , previousWidths .get (counter ));
115
122
itemInfo .getRenderer ().setProperty (Property .HEIGHT , previousHeights .get (counter ));
123
+ itemInfo .getRenderer ().setProperty (Property .MIN_HEIGHT , previousMinHeights .get (counter ));
116
124
++counter ;
117
125
}
118
126
}
0 commit comments