--- deliantra/Deliantra-Client/DC/UI.pm 2006/04/12 00:36:13 1.80 +++ deliantra/Deliantra-Client/DC/UI.pm 2006/04/12 12:20:00 1.84 @@ -135,7 +135,7 @@ $self->_size_allocate ($x, $y, $w, $h); } -# translate global koordinates to local coordinate system +# translate global coordinates to local coordinate system sub translate { my ($self, $x, $y) = @_; @@ -639,8 +639,6 @@ glBindTexture GL_TEXTURE_2D, $bg->{name}; glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; - glTexParameter GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT; - glTexParameter GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT; my $rep_x = $cw / $bg->{w}; my $rep_y = $ch / $bg->{h}; @@ -745,12 +743,11 @@ my $row_h = $hs->[$r]; for my $c (0 .. $#$row) { - my $widget = $row->[$c] - or next; - my $col_w = $ws->[$c]; - $widget->size_allocate ($x, $y, $col_w, $row_h); + if (my $widget = $row->[$c]) { + $widget->size_allocate ($x, $y, $col_w, $row_h); + } $x += $col_w; } @@ -943,6 +940,7 @@ $self->{layout}->set_markup ($text); delete $self->{texture}; +# $self->{w} = $self->{h} = -1; $self->update; } @@ -985,7 +983,7 @@ my $tex = $self->{texture} ||= do { $self->{layout}->set_width ($self->{w}); - $self->{layout}->set_height (List::Util::min $self->{h}, $self->{height}); + $self->{layout}->set_height (List::Util::min $self->{h} - $self->{padding} * 2, $self->{height}); new_from_layout CFClient::Texture $self->{layout} }; @@ -1001,7 +999,8 @@ : $self->{align} > 0 ? $self->{w} - $tex->{w} - $self->{padding} : ($self->{w} - $tex->{w}) * 0.5; - $tex->draw_quad ($x, $self->{padding}); + glTranslate $x, ($self->{h} - $tex->{h}) * 0.5, 0; + $tex->draw_quad (0, 0); glDisable GL_TEXTURE_2D; glDisable GL_BLEND; @@ -1035,6 +1034,7 @@ $self->{text} = $text; $self->{layout}->set_width ($self->{w}); + $self->{layout}->set_height (List::Util::min $self->{h} - $self->{padding} * 2, $self->{height}); $text =~ s/./*/g if $self->{hidden};