282 |
// Adjust spans so that we exactly fill the allocated region. If |
// Adjust spans so that we exactly fill the allocated region. If |
283 |
if (span > allocated) |
if (span > allocated) |
284 |
adjustSmaller(allocated, children, spans, span); |
adjustSmaller(allocated, children, spans, span); |
285 |
else |
else if (span < allocated) |
286 |
adjustGreater(allocated, children, spans, span); |
adjustGreater(allocated, children, spans, span); |
287 |
|
|
288 |
// Adjust offsets. |
// Adjust offsets. |
433 |
float align = children[i].alignment; |
float align = children[i].alignment; |
434 |
// Try to fit the component into the available space. |
// Try to fit the component into the available space. |
435 |
int[] spanAndOffset = new int[2]; |
int[] spanAndOffset = new int[2]; |
436 |
if (align < .5F) |
if (align < .5F || baseline == 0) |
437 |
adjustFromRight(children[i], baseline, allocated, spanAndOffset); |
adjustFromRight(children[i], baseline, allocated, spanAndOffset); |
438 |
else |
else |
439 |
adjustFromLeft(children[i], baseline, allocated, spanAndOffset); |
adjustFromLeft(children[i], baseline, allocated, spanAndOffset); |