ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/UI.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/UI.pm (file contents):
Revision 1.390 by root, Sat Jul 21 13:29:46 2007 UTC vs.
Revision 1.391 by root, Sat Jul 21 13:33:10 2007 UTC

1639 1639
1640 my (@w, @h); 1640 my (@w, @h);
1641 1641
1642 my @children = $self->children; 1642 my @children = $self->children;
1643 1643
1644 # first pass, columns
1644 for my $widget (sort { $b->{rowspan} * $b->{colspan} <=> $a->{rowspan} * $a->{colspan} } @children) { 1645 for my $widget (sort { $b->{colspan} <=> $a->{colspan} } @children) {
1645 my ($r, $c, $w, $h, $rs, $cs) = @$widget{qw(row col req_w req_h rowspan colspan)}; 1646 my ($c, $w, $cs) = @$widget{qw(col req_w colspan)};
1646 1647
1647 my $sw = sum @w[$c .. $c + $cs - 1]; 1648 my $sw = sum @w[$c .. $c + $cs - 1];
1648 my $sh = sum @h[$r .. $r + $rs - 1];
1649 1649
1650 if ($w > $sw) { 1650 if ($w > $sw) {
1651 $_ += ($w - $sw) / $cs for @w[$c .. $c + $cs - 1]; 1651 $_ += ($w - $sw) / $cs for @w[$c .. $c + $cs - 1];
1652 } 1652 }
1653 }
1654
1655 # second pass, rows
1656 for my $widget (sort { $b->{rowspan} <=> $a->{rowspan} } @children) {
1657 my ($r, $h, $rs) = @$widget{qw(row req_h rowspan)};
1658
1659 my $sh = sum @h[$r .. $r + $rs - 1];
1653 1660
1654 if ($h > $sh) { 1661 if ($h > $sh) {
1655 $_ += ($h - $sh) / $rs for @h[$r .. $r + $rs - 1]; 1662 $_ += ($h - $sh) / $rs for @h[$r .. $r + $rs - 1];
1656 } 1663 }
1657 } 1664 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines