340 |
// Sum up (maxSize - prefSize) over all children |
// Sum up (maxSize - prefSize) over all children |
341 |
int sumDelta = 0; |
int sumDelta = 0; |
342 |
for (int i = 0; i < children.length; i++) |
for (int i = 0; i < children.length; i++) |
343 |
sumDelta += children[i].maximum - children[i].preferred; |
{ |
344 |
|
sumDelta += children[i].maximum - children[i].preferred; |
345 |
|
if (sumDelta < 0) |
346 |
|
sumDelta = Integer.MAX_VALUE; |
347 |
|
} |
348 |
|
|
349 |
// If we have sumDelta == 0, then all components have prefSize == maxSize |
// If we have sumDelta == 0, then all components have prefSize == maxSize |
350 |
// and we can't do anything about it. |
// and we can't do anything about it. |