Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

pretty much working

  • Loading branch information...
commit b809dd7b6ed69e142b5da1e88a9a4e01445460aa 2 parents 5a26b87 + 9ccdd44
@lstein lstein authored
Showing with 12 additions and 12 deletions.
  1. +8 −1 lib/Bio/Graphics/Glyph/wiggle_xyplot.pm
  2. +4 −11 lib/Bio/Graphics/Panel.pm
View
9 lib/Bio/Graphics/Glyph/wiggle_xyplot.pm
@@ -295,12 +295,19 @@ sub draw_plot {
}
} @$parts;
+ my $svg_workaround = $gd->isa('GD::SVG::Image');
+
$self->panel->startGroup($gd);
my $type = $self->graph_type;
if ($type eq 'boxes') {
for (@points) {
my ($x1,$y1,$x2,$y2,$color,$lw) = @$_;
- $gd->filledRectangle($x1,$y1,$x2,$y2,$color) if abs($y2-$y1) > 0;
+ next unless abs($y2-$y1) > 0;
+ if ($svg_workaround && $x1==$x2) {
+ $gd->line($x1,$y1,$x2,$y2,$color);
+ } else {
+ $gd->filledRectangle($x1,$y1,$x2,$y2,$color);
+ }
}
}
View
15 lib/Bio/Graphics/Panel.pm
@@ -74,12 +74,10 @@ sub new {
$length ||= $options{-stop}-$options{-start}+1
if defined $options{-start} && defined $options{-stop};
- # bring in the image generator class, since we will need it soon anyway
- #eval "require $image_class; 1" or $class->throw($@);
- #{
- #local $^W = 0;
- #eval "GD::Image->useFontConfig(1)";
- #}
+ unless ($image_class->can('new')) {
+ eval "require $image_class; 1" or $class->throw($@);
+ }
+ $keyfont = eval {$image_class->$keyfont} || $image_class->gdMediumBoldFont;
return bless {
tracks => [],
@@ -490,11 +488,6 @@ sub get_gd {
my $existing_gd = shift;
return $self->{gd} if $self->{gd};
- unless ($existing_gd) {
- my $image_class = $self->image_class;
- eval "require $image_class; 1" or $self->throw($@);
- }
-
my $height = $self->height;
my $width = $self->width + $self->pad_left + $self->pad_right;
my $pkg = $self->image_package;
Please sign in to comment.
Something went wrong with that request. Please try again.