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.79 by root, Wed Apr 12 00:26:50 2006 UTC vs.
Revision 1.81 by root, Wed Apr 12 00:40:45 2006 UTC

941 941
942 $self->{text} = $text; 942 $self->{text} = $text;
943 $self->{layout}->set_markup ($text); 943 $self->{layout}->set_markup ($text);
944 944
945 delete $self->{texture}; 945 delete $self->{texture};
946# $self->{w} = $self->{h} = -1;
946 $self->update; 947 $self->update;
947} 948}
948 949
949sub get_text { 950sub get_text {
950 my ($self, $text) = @_; 951 my ($self, $text) = @_;
983sub _draw { 984sub _draw {
984 my ($self) = @_; 985 my ($self) = @_;
985 986
986 my $tex = $self->{texture} ||= do { 987 my $tex = $self->{texture} ||= do {
987 $self->{layout}->set_width ($self->{w}); 988 $self->{layout}->set_width ($self->{w});
988 $self->{layout}->set_height (List::Util::min $self->{h}, $self->{height}); 989 $self->{layout}->set_height (List::Util::min $self->{h} - $self->{padding} * 2, $self->{height});
989 new_from_layout CFClient::Texture $self->{layout} 990 new_from_layout CFClient::Texture $self->{layout}
990 }; 991 };
991 992
992 glEnable GL_BLEND; 993 glEnable GL_BLEND;
993 glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; 994 glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA;
1318 $value = int +($value - $lo) * $w / ($hi - $lo); 1319 $value = int +($value - $lo) * $w / ($hi - $lo);
1319 1320
1320 $w -= $page; 1321 $w -= $page;
1321 $page &= ~1; 1322 $page &= ~1;
1322 glTranslate $page * 0.5, 0, 0; 1323 glTranslate $page * 0.5, 0, 0;
1324 $page ||= 2;
1323 1325
1324 glColor @$fg; 1326 glColor @$fg;
1325 glBegin GL_LINES; 1327 glBegin GL_LINES;
1326 glVertex 0, 0; glVertex 0, $h; 1328 glVertex 0, 0; glVertex 0, $h;
1327 glVertex $w - 1, 0; glVertex $w - 1, $h; 1329 glVertex $w - 1, 0; glVertex $w - 1, $h;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines