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.186 by root, Mon May 8 20:39:34 2006 UTC vs.
Revision 1.188 by root, Mon May 8 21:16:09 2006 UTC

530 530
531 $self 531 $self
532} 532}
533 533
534sub add { 534sub add {
535 my ($self, $child) = @_; 535 my ($self, @widgets) = @_;
536 536
537 $child->set_parent ($self); 537 $_->set_parent ($self)
538 for @widgets;
538 539
539 use sort 'stable'; 540 use sort 'stable';
540 541
541 $self->{children} = [ 542 $self->{children} = [
542 sort { $a->{z} <=> $b->{z} } 543 sort { $a->{z} <=> $b->{z} }
543 @{$self->{children}}, $child 544 @{$self->{children}}, @widgets
544 ]; 545 ];
545 546
546 $child->check_size; 547 $_->check_size
548 for @widgets;
549
547 $self->update; 550 $self->update;
548} 551}
549 552
550sub children { 553sub children {
551 @{ $_[0]{children} } 554 @{ $_[0]{children} }
2702 my $old_h = $self->{old_h}; 2705 my $old_h = $self->{old_h};
2703 2706
2704 if ($old_w && $old_h) { 2707 if ($old_w && $old_h) {
2705 for my $child ($self->children) { 2708 for my $child ($self->children) {
2706 $child->{x} = int 0.5 + $child->{x} * $w / $old_w; 2709 $child->{x} = int 0.5 + $child->{x} * $w / $old_w;
2707 $child->{w} = int 0.5 + $child->{req_w} * $w / $old_w; 2710 $child->{w} = int 0.5 + $child->{w} * $w / $old_w;
2708 $child->{req_w} = int 0.5 + $child->{req_w} * $w / $old_w if exists $child->{req_w}; 2711 $child->{req_w} = int 0.5 + $child->{req_w} * $w / $old_w if exists $child->{req_w};
2709 $child->{user_w} = int 0.5 + $child->{user_w} * $w / $old_w if exists $child->{user_w}; 2712 $child->{user_w} = int 0.5 + $child->{user_w} * $w / $old_w if exists $child->{user_w};
2710 $child->{y} = int 0.5 + $child->{y} * $h / $old_h; 2713 $child->{y} = int 0.5 + $child->{y} * $h / $old_h;
2711 $child->{h} = int 0.5 + $child->{h} * $h / $old_h; 2714 $child->{h} = int 0.5 + $child->{h} * $h / $old_h;
2712 $child->{req_h} = int 0.5 + $child->{req_h} * $h / $old_h if exists $child->{req_h}; 2715 $child->{req_h} = int 0.5 + $child->{req_h} * $h / $old_h if exists $child->{req_h};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines