16f4efdef2c1c69e6beeae96bbc35ffa7df4c324 tdreszer Wed Aug 31 13:34:48 2011 -0700 How embarassing... draScroll wasn't working correctly in reverseComp. diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index 0db3f4c..586103a 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -1203,31 +1203,35 @@ hgTracks.imgBoxPortalLeft = newX.toString() + "px"; } } } } }); // end of this.each(function(){ function panUpdatePosition(newOffsetX,bounded) { // Updates the 'position/search" display with change due to panning var closedPortalStart = hgTracks.imgBoxPortalStart + 1; // Correction for half open portal coords var portalWidthBases = hgTracks.imgBoxPortalEnd - closedPortalStart; var portalScrolledX = (hgTracks.imgBoxPortalOffsetX+hgTracks.imgBoxLeftLabel) + newOffsetX; var recalculate = false; - var newPortalStart = closedPortalStart - Math.round(portalScrolledX*hgTracks.imgBoxBasesPerPixel); // As offset goes down, bases seen goes up! + var newPortalStart = 0; + if (hgTracks.revCmplDisp) + newPortalStart = closedPortalStart + Math.round(portalScrolledX*hgTracks.imgBoxBasesPerPixel); // As offset goes down, so do bases seen. + else + newPortalStart = closedPortalStart - Math.round(portalScrolledX*hgTracks.imgBoxBasesPerPixel); // As offset goes down, bases seen goes up! if( newPortalStart < hgTracks.chromStart && bounded) { // Stay within bounds newPortalStart = hgTracks.chromStart; recalculate = true; } var newPortalEnd = newPortalStart + portalWidthBases; if( newPortalEnd > hgTracks.chromEnd && bounded) { newPortalEnd = hgTracks.chromEnd; newPortalStart = newPortalEnd - portalWidthBases; recalculate = true; } if(newPortalStart > 0) { var newPos = hgTracks.chromName + ":" + commify(newPortalStart) + "-" + commify(newPortalEnd); setPosition(newPos, 0); // 0 means no need to change the size } if (recalculate && hgTracks.imgBoxBasesPerPixel > 0) { // Need to recalculate X for bounding drag