--- deliantra/Deliantra-Client/DC/UI.pm 2006/04/19 23:55:58 1.139 +++ deliantra/Deliantra-Client/DC/UI.pm 2006/04/20 04:20:52 1.140 @@ -151,6 +151,11 @@ $self->{x} = $x; $self->{y} = $y; + if ($self->{aspect}) { + $w = List::Util::min $w, int $h * $self->{aspect}; + $h = List::Util::min $h, int $w / $self->{aspect}; + } + return unless $self->{w} != $w || $self->{h} != $h; $self->{w} = $w; @@ -1451,7 +1456,12 @@ sub new { my $class = shift; - my $self = $class->SUPER::new (gauge => 'food', @_); + my $self = $class->SUPER::new ( + gauge => 'food', + @_ + ); + + $self->{aspect} = $tex{$self->{gauge}}[0]{w} / $tex{$self->{gauge}}[0]{h}; $self }