Permalink
Browse files

respect object syntax for text_out and friends

  • Loading branch information...
dk committed Jan 12, 2018
1 parent c5a9419 commit e9335bb79aafd09287e0f5003e4c173ab2dc6af6
Showing with 3 additions and 0 deletions.
  1. +3 −0 Prima/PS/Drawable.pm
View
@@ -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);
@@ -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;
@@ -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;

0 comments on commit e9335bb

Please sign in to comment.