r55338 - in /branches/upstream/libchart-clicker-perl/current: Changes META.yml lib/Chart/Clicker.pm lib/Chart/Clicker/Renderer/Pie.pm

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Sat Apr 3 04:01:05 UTC 2010


Author: jawnsy-guest
Date: Sat Apr  3 04:00:56 2010
New Revision: 55338

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=55338
Log:
[svn-upgrade] Integrating new upstream version, libchart-clicker-perl (2.60)

Modified:
    branches/upstream/libchart-clicker-perl/current/Changes
    branches/upstream/libchart-clicker-perl/current/META.yml
    branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker.pm
    branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker/Renderer/Pie.pm

Modified: branches/upstream/libchart-clicker-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libchart-clicker-perl/current/Changes?rev=55338&op=diff
==============================================================================
--- branches/upstream/libchart-clicker-perl/current/Changes (original)
+++ branches/upstream/libchart-clicker-perl/current/Changes Sat Apr  3 04:00:56 2010
@@ -1,4 +1,11 @@
 Revision history for Perl extension Chart::Clicker.
+
+2.60    March 20, 2010
+  - Add gradient_reverse attribute to Pie renderer for reverse the
+    direction of the gradient (Carl Chambers)
+  - Add starting_angle attribute to Pie rather than hardcoding it to -90
+    (Carl Chambers)
+  - Refactor some Pie internals to not use $self->{VAR} (Carl Chambers)
 
 2.59
   - Correct POD in PolarArea

Modified: branches/upstream/libchart-clicker-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libchart-clicker-perl/current/META.yml?rev=55338&op=diff
==============================================================================
--- branches/upstream/libchart-clicker-perl/current/META.yml (original)
+++ branches/upstream/libchart-clicker-perl/current/META.yml Sat Apr  3 04:00:56 2010
@@ -38,4 +38,4 @@
 resources:
   license: http://dev.perl.org/licenses/
   repository: http://github.com/gphat/chart-clicker
-version: 2.59
+version: 2.60

Modified: branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker.pm?rev=55338&op=diff
==============================================================================
--- branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker.pm (original)
+++ branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker.pm Sat Apr  3 04:00:56 2010
@@ -24,7 +24,7 @@
 use Carp qw(croak);
 use Scalar::Util qw(refaddr);
 
-our $VERSION = '2.59';
+our $VERSION = '2.60';
 
 has '+background_color' => (
     default => sub {

Modified: branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker/Renderer/Pie.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker/Renderer/Pie.pm?rev=55338&op=diff
==============================================================================
--- branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker/Renderer/Pie.pm (original)
+++ branches/upstream/libchart-clicker-perl/current/lib/Chart/Clicker/Renderer/Pie.pm Sat Apr  3 04:00:56 2010
@@ -25,6 +25,16 @@
     is => 'rw',
     isa => 'Graphics::Color::RGB',
     predicate => 'has_gradient_color'
+);
+has 'gradient_reverse' => (
+    is => 'rw',
+    isa	=> 'Bool',
+    default => 0,
+);
+has 'starting_angle' => (
+    is => 'rw',
+    isa	=> 'Int',
+    default => -90,
 );
 
 my $TO_RAD = (4 * atan2(1, 1)) / 180;
@@ -53,21 +63,21 @@
 
     my $clicker = $self->clicker;
 
-    $self->{RADIUS} = $self->height;
+    my $radius = $self->height;
     if($self->width < $self->height) {
-        $self->{RADIUS} = $self->width;
+        $radius = $self->width;
     }
 
-    $self->{RADIUS} = $self->{RADIUS} / 2;
+    $radius = $radius / 2;
 
     # Take into acount the line around the edge when working out the radius
-    $self->{RADIUS} -= $self->brush->width;
+    $radius -= $self->brush->width;
 
     my $height = $self->height;
     my $linewidth = 1;
     my $midx = $self->width / 2;
     my $midy = $height / 2;
-    $self->{POS} = -90;
+    my $pos = $self->starting_angle;
 
     my $dses = $clicker->get_datasets_for_context($self->context);
     foreach my $ds (@{ $dses }) {
@@ -79,10 +89,10 @@
             my $range = $ctx->range_axis;
 
             my $avg = $self->{ACCUM}->{refaddr($series)} / $self->{TOTAL};
-            my $degs = ($avg * 360) + $self->{POS};
+            my $degs = ($avg * 360) + $pos;
 
             $self->move_to($midx, $midy);
-            $self->arc($self->{RADIUS}, $degs * $TO_RAD, $self->{POS} * $TO_RAD);
+            $self->arc($radius, $degs * $TO_RAD, $pos * $TO_RAD);
 
             $self->close_path;
 
@@ -91,14 +101,22 @@
             my $paint;
             if($self->has_gradient_color) {
                 my $gc = $self->gradient_color;
+                my $start_radius = 0;
+                my $end_radius = $radius;
+
+                if($self->gradient_reverse) {
+                    $start_radius = $radius;
+                    $end_radius = 0;
+                }
+
                 $paint = Graphics::Primitive::Paint::Gradient::Radial->new(
                     start => Geometry::Primitive::Circle->new(
                         origin => [ $midx, $midy ],
-                        radius => 0
+                        radius => $start_radius
                     ),
                     end => Geometry::Primitive::Circle->new(
                         origin => [ $midx, $midy ],
-                        radius => $self->{RADIUS}
+                        radius => $end_radius
                     )
                 );
                 $paint->add_stop(0, $color);
@@ -124,7 +142,7 @@
             $op->brush->color($self->border_color);
             $self->do($op);
 
-            $self->{POS} = $degs;
+            $pos = $degs;
         }
     }
 




More information about the Pkg-perl-cvs-commits mailing list