Subject: | Layout::Manager::Flow doesnt render Graphics::Primitive::Image |
As described in the subject, the Layout::Manager::Flow doesnt render Graphics::Primitive::Image objects. ::Compass and ::Single worked fine.
Here is a sample script...
---
#!/usr/bin/perl
use strict;
use warnings;
use Graphics::Primitive::Container;
use Graphics::Color::RGB;
use Graphics::Primitive::Font;
use Graphics::Primitive::TextBox;
use Graphics::Primitive::Driver::Cairo;
use Graphics::Primitive::Image;
use Layout::Manager::Flow;
my $black = Graphics::Color::RGB->new( red => 0, green => 0, blue => 0 );
my $white = Graphics::Color::RGB->new( red => 1, green => 1, blue => 1 );
my $w = my $h = 500;
my $container = Graphics::Primitive::Container->new(
width => $w,
height => $h,
# background_color => $white,
);
$container->padding(
Graphics::Primitive::Insets->new(
top => 5,
bottom => 5,
left => 5,
right => 5
)
);
my $img = Graphics::Primitive::Image->new(
image => '/tmp/rageguy.png',
horizontal_alignment => 'left',
vertical_alignment => 'top',
);
$container->add_component($img);
for my $try ( 1..2 ) {
print "$try\n";
my $tx = Graphics::Primitive::TextBox->new(
color => $white,
horizontal_alignment => 'center',
# vertical_alignment => 'center',
font => Graphics::Primitive::Font->new(
face => 'Arial',
size => 18, # slant => 'normal',
),
text => sprintf( 'Here is some text %d!', $try ),
);
$container->add_component($tx);
}
my $driver =
Graphics::Primitive::Driver::Cairo->new( width => $w, height => $h );
$driver->prepare($container);
#$driver->finalize($container);
print "got here\n";
my $lm = Layout::Manager::Flow->new();
$lm->do_layout($container);
print "got here\n";
$driver->draw($container);
print "got here\n";
$driver->write('/tmp/foo.png');
---
Perhaps this is more correctly a bug in Graphics::Primitive::Image