Skip to content

Commit

Permalink
make GenomeView maxVisible and minVisible report being right at the e…
Browse files Browse the repository at this point in the history
…nd of the refseq if they are within less than a pixel width of it. Fixes #24.
  • Loading branch information
rbuels committed Apr 2, 2012
1 parent 11dcf7d commit af6a469
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions js/GenomeView.js
Expand Up @@ -691,11 +691,24 @@ GenomeView.prototype.centerAtBase = function(base, instantly) {
};

GenomeView.prototype.minVisible = function() {
return this.pxToBp(this.x + this.offset);
var mv = this.pxToBp(this.x + this.offset);

// if we are less than one pixel from the beginning of the ref
// seq, just say we are at the beginning.
if( mv < this.pxToBp(1) )
return 0;
else
return mv;
};

GenomeView.prototype.maxVisible = function() {
return this.pxToBp(this.x + this.offset + this.dim.width);
var mv = this.pxToBp(this.x + this.offset + this.dim.width);
// if we are less than one pixel from the end of the ref
// seq, just say we are at the end.
if( mv > this.ref.end - this.pxToBp(1) )
return this.ref.end;
else
return mv;
};

GenomeView.prototype.showFine = function() {
Expand Down

0 comments on commit af6a469

Please sign in to comment.