… | |
… | |
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 | |
949 | sub get_text { |
950 | sub get_text { |
950 | my ($self, $text) = @_; |
951 | my ($self, $text) = @_; |
… | |
… | |
983 | sub _draw { |
984 | sub _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; |