--- deliantra/Deliantra-Client/DC/UI.pm 2007/12/27 19:12:19 1.455 +++ deliantra/Deliantra-Client/DC/UI.pm 2007/12/28 15:05:33 1.458 @@ -1641,7 +1641,7 @@ my $sw = sum @w[$c .. $c + $cs - 1]; if ($w > $sw) { - $_ += ($w - $sw) / ($sw ? $sw / $_ : $cs) for @w[$c .. $c + $cs - 1]; + $_ += ($w - $sw) / ($_ ? $sw / $_ : $cs) for @w[$c .. $c + $cs - 1]; } } @@ -1652,7 +1652,7 @@ my $sh = sum @h[$r .. $r + $rs - 1]; if ($h > $sh) { - $_ += ($h - $sh) / ($sh ? $sh / $_ : $rs) for @h[$r .. $r + $rs - 1]; + $_ += ($h - $sh) / ($_ ? $sh / $_ : $rs) for @h[$r .. $r + $rs - 1]; } } @@ -2098,6 +2098,8 @@ valign => 0, can_events => 1, ellipsise => 0, + padding_x => 4, + padding_y => 2, #text => ... #hidden => "*", @_ @@ -2338,14 +2340,24 @@ use DC::OpenGL; +sub new { + my $class = shift; + + $class->SUPER::new ( + padding_y => 4, + + @_ + ) +} + sub move_cursor_ver { my ($self, $dy) = @_; - my ($y, $x) = $self->{layout}->index_to_line_x ($self->{cursor}); + my ($line, $x) = $self->{layout}->index_to_line_x ($self->{cursor}); - $y += $dy; + $line += $dy; - if (defined (my $index = $self->{layout}->line_x_to_index ($y, $x))) { + if (defined (my $index = $self->{layout}->line_x_to_index ($line, $x))) { $self->{cursor} = $index; delete $self->{cur_h}; $self->update;