Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

allowing you to set empty/undef text in write_to() and write_xy()

  • Loading branch information...
commit 1cceb791c8caee77ce7cc59a7f166fdefcc90fe1 1 parent 01b8dd7
@garu garu authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/SDLx/Text.pm
View
4 lib/SDLx/Text.pm
@@ -148,7 +148,7 @@ sub surface {
sub write_to {
my ($self, $target, $text) = @_;
- $self->text($text) if $text;
+ $self->text($text) if scalar @_ > 2;
if ( my $surface = $self->{surface} ) {
if ($self->{h_align} eq 'center' ) {
$self->{x} = ($target->w / 2) - ($surface->w / 2);
@@ -166,7 +166,7 @@ sub write_to {
sub write_xy {
my ($self, $target, $x, $y, $text) = @_;
- $self->text($text) if $text;
+ $self->text($text) if scalar @_ > 4;
if ( my $surface = $self->{surface} ) {
SDL::Video::blit_surface(
Please sign in to comment.
Something went wrong with that request. Please try again.