$beg = $cookie->{ 'NAV_START' };
$end = $cookie->{ 'NAV_END' };
- $factor = $cookie->{ 'IMG_WIDTH' } / ( $end - $beg );
+ $factor = $cookie->{ 'IMG_WIDTH' } / ( $end - $beg + 1 );
$step = 10;
{
if ( ( $i % $step ) == 0 )
{
- $txt = Maasha::Calc::commify( $i ) . "|"; # TODO reverse this so |123 instead of 123|
- $x = sprintf( "%.0f", ( $i - $beg - length $txt ) * $factor );
+ $txt = "|" . Maasha::Calc::commify( $i );
+ $x = sprintf( "%.0f", ( ( $i - $beg ) * $factor ) + 2 );
if ( $x > 0 and $x + ( $cookie->{ 'RULER_FONT_SIZE' } * length $txt ) < $cookie->{ 'IMG_WIDTH' } )
{
@{ $entries } = sort { $a->{ 'S_BEG' } <=> $b->{ 'S_BEG' } or $a->{ 'S_END' } <=> $b->{ 'S_END' } } @{ $entries };
- $factor = $cookie->{ 'IMG_WIDTH' } / ( $end - $beg );
+ $factor = $cookie->{ 'IMG_WIDTH' } / ( $end - $beg + 1 );
$y_step = 0;
$y_max = 0;
'S_ID' => $entry->[ seqid ],
'SOURCE' => $entry->[ source ],
'TYPE' => $entry->[ type ],
- 'S_BEG' => $entry->[ start ],
- 'S_END' => $entry->[ end ],
- 'S_LEN' => $entry->[ end ] - $entry->[ start ] + 1,
+ 'S_BEG' => $entry->[ start ] - 1,
+ 'S_END' => $entry->[ end ] - 1,
+ 'S_LEN' => $entry->[ end ] - $entry->[ start ] + 1,
'SCORE' => $entry->[ score ],
'STRAND' => $entry->[ strand ],
'PHASE' => $entry->[ phase ],
if ( defined $cookie->{ 'NAV_START' } )
{
$cookie->{ 'NAV_START' } =~ tr/,//d;
- $cookie->{ 'NAV_START' } = 1 if $cookie->{ 'NAV_START' } <= 0;
+ $cookie->{ 'NAV_START' } = 0 if $cookie->{ 'NAV_START' } < 0;
}
else
{
- $cookie->{ 'NAV_START' } = 1;
+ $cookie->{ 'NAV_START' } = 0;
}
}
$cookie->{ 'NAV_START' } = int( $cookie->{ 'NAV_START' } + ( $dist_diff / 2 ) );
$cookie->{ 'NAV_END' } = int( $cookie->{ 'NAV_END' } - ( $dist_diff / 2 ) );
- $cookie->{ 'NAV_START' } = 1 if $cookie->{ 'NAV_START' } <= 0;
+ $cookie->{ 'NAV_START' } = 0 if $cookie->{ 'NAV_START' } < 0;
$cookie->{ 'NAV_END' } = $max if $cookie->{ 'NAV_END' } > $max;
}
}
$surface = Cairo::ImageSurface->create( 'argb32', $cookie->{ 'IMG_WIDTH' }, $cookie->{ 'TRACK_OFFSET' } );
$cr = Cairo::Context->create( $surface );
- $cr->rectangle (0, 0, $cookie->{ 'IMG_WIDTH' }, $cookie->{ 'TRACK_OFFSET' } );
- $cr->set_source_rgb (1, 1, 1);
+ $cr->rectangle ( 0, 0, $cookie->{ 'IMG_WIDTH' }, $cookie->{ 'TRACK_OFFSET' } );
+ $cr->set_source_rgb ( 1, 1, 1 );
$cr->fill;
foreach $feat ( @features ) {