Skip to content

Commit

Permalink
respect object syntax for text_out and friends
Browse files Browse the repository at this point in the history
  • Loading branch information
dk committed Jan 12, 2018
1 parent c5a9419 commit e9335bb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Prima/PS/Drawable.pm
Expand Up @@ -899,6 +899,7 @@ SECTOR
sub text_out
{
my ( $self, $text, $x, $y) = @_;
return $text->text_out($self, $x, $y) if ref $text;
return 0 unless $self-> {canDraw} and length $text;
$y += $self-> {font}-> {descent} if !$self-> textOutBaseline;
( $x, $y) = $self-> pixel2point( $x, $y);
Expand Down Expand Up @@ -1627,6 +1628,7 @@ sub get_font_ranges
sub get_text_width
{
my ( $self, $text, $addOverhang) = @_;
return $text->get_text_width($self, $addOverhang) if ref $text;

my $i;
my $len = length $text;
Expand All @@ -1652,6 +1654,7 @@ sub get_text_width
sub get_text_box
{
my ( $self, $text) = @_;
return $text->get_text_box($self) if ref $text;
my ( $rmap, $nd) = $self-> get_rmap;
my $len = length $text;
return [ (0) x 10 ] unless $len;
Expand Down

0 comments on commit e9335bb

Please sign in to comment.