Subject: | ellipse generating fractional x,y points |
Date: | Tue, 06 Jul 2010 10:07:18 +1000 |
To: | bug-Image-Base [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
With Image::Base 1.07 the program foo.pl gets some fractional
coordinates going to xy() from an ellipse() call,
x=3.5 y=3 white
where I hoped a subclass would see just integers from the base drawing.
The 0.5 ones near the end like
x=0.5 y=2 white
seem particularly doubtful since rounding that down draws at x=0 which
is outside the requested box 1,1 to 6,3.
use strict;
use warnings;
{
package MyImage;
use base 'Image::Base';
sub new {
my ($class, %self) = @_;
return bless \%self, $class;
}
sub xy {
my ($self, $x, $y, $colour) = @_;
print "x=$x y=$y $colour\n";
}
}
my $image = MyImage->new(-width => 10,
-height => 10);
$image->ellipse (1,1, 6,3, 'white');