Skip to content

Commit

Permalink
in alignment tracks, place mismatch markers using percentages instead…
Browse files Browse the repository at this point in the history
… of pixel offsets so that the zoom animations look right
  • Loading branch information
rbuels committed Oct 17, 2012
1 parent 1a379ad commit f03783a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/JBrowse/View/Track/Alignments.js
Expand Up @@ -25,14 +25,15 @@ return declare( HTMLFeatures,
var mismatches = this._getMismatches( feature );
var charSize = this.getCharacterMeasurements();
var drawChars = scale >= charSize.w;
var featureLength = feature.get('end') - feature.get('start');

array.forEach( mismatches, function( mismatch ) {
array.forEach( mismatch.bases, function( base, i ) {
dojo.create('span', {
className: 'mismatch base base_'+(base == '*' ? 'deletion' : base.toLowerCase()),
style: {
position: 'absolute',
left: scale * (mismatch.start+i) + 'px',
left: (mismatch.start+i)/featureLength*100 + '%',
width: scale + 'px'
},
innerHTML: drawChars ? base : ''
Expand Down

0 comments on commit f03783a

Please sign in to comment.