19 |
|
|
20 |
foreach my $object (@alignees) |
foreach my $object (@alignees) |
21 |
{ |
{ |
22 |
# If object's width not set, make it as high as the box |
# If object's width not set, make it as wide as the box |
23 |
my $width = $object->width || $object->width($self->width); |
my $width = $object->width || $object->width($self->width); |
24 |
|
|
25 |
# Place object in the vertical according to alignment |
# Place object in the vertical according to alignment |
54 |
|
|
55 |
# Now lay out the elements |
# Now lay out the elements |
56 |
my $alignment = $self->valign; |
my $alignment = $self->valign; |
57 |
my $cursor = $self->y; # Default alignment is left |
my $cursor = $self->y; # Default alignment is top |
58 |
$cursor += int($free_space/2) if $alignment =~ /^center$/; |
$cursor += int($free_space/2) if $alignment =~ /^center$/; |
59 |
$cursor += $free_space if $alignment =~ /^right$/; |
$cursor += $free_space if $alignment =~ /^bottom$/; |
60 |
map {$_->y($cursor); $cursor += $_->height} @alignees; |
map {$_->y($cursor); $cursor += $_->height} @alignees; |
61 |
|
|
62 |
} |
} |