- round the pie radius down to avoid running over the edge of the
authorTony Cook <tony@develop-help.com>
Mon, 21 Apr 2008 08:29:13 +0000 (08:29 +0000)
committerTony Cook <tony@develop-help.com>
Mon, 21 Apr 2008 08:29:13 +0000 (08:29 +0000)
   image

Changes
lib/Imager/Graph/Pie.pm
testimg/t10_hlegend.png
testimg/t10_mono.png
testimg/t10_noother.png
testimg/t10_pie1.png
testimg/t10_pie2.png
testimg/t10_rad_fount.png

diff --git a/Changes b/Changes
index 0b9e82f..0965c96 100644 (file)
--- a/Changes
+++ b/Changes
@@ -18,6 +18,9 @@ Imager-Graph 0.06 - unreleased
    drawing zero sized segments.
    https://rt.cpan.org/Ticket/Display.html?id=34813
 
+ - round the pie radius down to avoid running over the edge of the
+   image
+
 Imager-Graph 0.05 - 17 December 2007
 =================
 
index 84047df..72c8322 100644 (file)
@@ -252,7 +252,7 @@ sub draw {
     int($self->_small_extent(\@chart_box) * $style->{pie}{size} * 0.5);
   my $max_width = $chart_box[2] - $chart_box[0] + $ebox[0] - $ebox[2];
   if ($radius > $max_width / 2) {
-    $radius = $max_width / 2;
+    $radius = int($max_width / 2);
   }
   $chart_box[0] -= $ebox[0];
   $chart_box[2] -= $ebox[2];
index f236336..7844d2f 100644 (file)
Binary files a/testimg/t10_hlegend.png and b/testimg/t10_hlegend.png differ
index dfa0ce6..31f4007 100644 (file)
Binary files a/testimg/t10_mono.png and b/testimg/t10_mono.png differ
index fd9f414..d0783a3 100644 (file)
Binary files a/testimg/t10_noother.png and b/testimg/t10_noother.png differ
index b9a7105..3de05b1 100644 (file)
Binary files a/testimg/t10_pie1.png and b/testimg/t10_pie1.png differ
index 4cb3365..293f504 100644 (file)
Binary files a/testimg/t10_pie2.png and b/testimg/t10_pie2.png differ
index bbfbc4f..1edf40e 100644 (file)
Binary files a/testimg/t10_rad_fount.png and b/testimg/t10_rad_fount.png differ