r55341 - in /trunk/libchart-clicker-perl: Changes META.yml debian/changelog 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:03:39 UTC 2010
Author: jawnsy-guest
Date: Sat Apr 3 04:03:30 2010
New Revision: 55341
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=55341
Log:
update to latest upstream version
Modified:
trunk/libchart-clicker-perl/Changes
trunk/libchart-clicker-perl/META.yml
trunk/libchart-clicker-perl/debian/changelog
trunk/libchart-clicker-perl/lib/Chart/Clicker.pm
trunk/libchart-clicker-perl/lib/Chart/Clicker/Renderer/Pie.pm
Modified: trunk/libchart-clicker-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libchart-clicker-perl/Changes?rev=55341&op=diff
==============================================================================
--- trunk/libchart-clicker-perl/Changes (original)
+++ trunk/libchart-clicker-perl/Changes Sat Apr 3 04:03:30 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: trunk/libchart-clicker-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libchart-clicker-perl/META.yml?rev=55341&op=diff
==============================================================================
--- trunk/libchart-clicker-perl/META.yml (original)
+++ trunk/libchart-clicker-perl/META.yml Sat Apr 3 04:03:30 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: trunk/libchart-clicker-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libchart-clicker-perl/debian/changelog?rev=55341&op=diff
==============================================================================
--- trunk/libchart-clicker-perl/debian/changelog (original)
+++ trunk/libchart-clicker-perl/debian/changelog Sat Apr 3 04:03:30 2010
@@ -1,5 +1,5 @@
-libchart-clicker-perl (2.59-1) UNRELEASED; urgency=low
+libchart-clicker-perl (2.60-1) UNRELEASED; urgency=low
- * Initial Release.
+ * Initial Release
- -- Jonathan Yu <jawnsy at cpan.org> Tue, 9 Mar 2010 20:34:00 -0500
+ -- Jonathan Yu <jawnsy at cpan.org> Sat, 03 Apr 2010 00:34:56 -0400
Modified: trunk/libchart-clicker-perl/lib/Chart/Clicker.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libchart-clicker-perl/lib/Chart/Clicker.pm?rev=55341&op=diff
==============================================================================
--- trunk/libchart-clicker-perl/lib/Chart/Clicker.pm (original)
+++ trunk/libchart-clicker-perl/lib/Chart/Clicker.pm Sat Apr 3 04:03:30 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: trunk/libchart-clicker-perl/lib/Chart/Clicker/Renderer/Pie.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libchart-clicker-perl/lib/Chart/Clicker/Renderer/Pie.pm?rev=55341&op=diff
==============================================================================
--- trunk/libchart-clicker-perl/lib/Chart/Clicker/Renderer/Pie.pm (original)
+++ trunk/libchart-clicker-perl/lib/Chart/Clicker/Renderer/Pie.pm Sat Apr 3 04:03:30 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