Fixing a very weird bug in the Pie Chart

This commit is contained in:
Martin Kamerbeek 2006-05-09 15:50:46 +00:00
parent 22d30f3f47
commit d5dfa4b84d

View file

@ -64,7 +64,7 @@ sub addSlice {
# Work around a bug in imagemagick where an A path with the same start and end point will segfault. # Work around a bug in imagemagick where an A path with the same start and end point will segfault.
if ($percentage == 1) { if ($percentage == 1) {
$percentage = 0.9999999; $percentage = 0.999999999;
} }
my $label = $properties->{label}; my $label = $properties->{label};
@ -103,7 +103,7 @@ sub addSlice {
topHeight => $self->getTopHeight, topHeight => $self->getTopHeight,
bottomHeight => $self->getBottomHeight, bottomHeight => $self->getBottomHeight,
explosionLength => $self->getExplosionLength, explosionLength => $self->getExplosionLength,
scaleFactor => $self->getScaleFactor, scaleFactor => $self->getScaleFactor || 1,
# keep the slice number for debugging properties # keep the slice number for debugging properties
sliceNr => scalar(@{$self->{_slices}}), sliceNr => scalar(@{$self->{_slices}}),
@ -925,7 +925,8 @@ Defaults to 1.
sub getScaleFactor { sub getScaleFactor {
my $self = shift; my $self = shift;
return $self->{_pieProperties}->{scaleFactor} || 1; return 1 unless (defined $self->{_pieProperties}->{scaleFactor});
return $self->{_pieProperties}->{scaleFactor} || '1';
} }
#------------------------------------------------------------------- #-------------------------------------------------------------------