9800980414cee0aef48710ef5162e386743150c3
kent
  Thu Apr 28 16:49:57 2011 -0700
Fixing Katrina's 7) Rainbow tracks: when Display mode is set to 'dense' and the Overlay method is set to 'none,' in hgTracks the labels are shifted down, resulting in partially cutting-off the bottom-most label.
diff --git src/hg/hgTracks/multiWig.c src/hg/hgTracks/multiWig.c
index 839b78c..62abd07 100644
--- src/hg/hgTracks/multiWig.c
+++ src/hg/hgTracks/multiWig.c
@@ -194,33 +194,43 @@
     wigLeftAxisLabels(tg, seqStart, seqEnd, hvg, xOff, yOff, width, height, withCenterLabels,
 	    font, color, vis, tg->shortLabel, subtrack->graphUpperLimit, 
 	    subtrack->graphLowerLimit, showNumbers);
     }
 else
     {
     struct track *subtrack;
     int y = yOff;
     if (withCenterLabels)
        y += tl.fontHeight+1;
     for (subtrack = tg->subtracks; subtrack != NULL; subtrack = subtrack->next)
 	{
 	if (isSubtrackVisible(subtrack))
 	    {
 	    int height = subtrack->totalHeight(subtrack, vis);
-	    wigLeftAxisLabels(subtrack, seqStart, seqEnd, hvg, xOff, y, width, height, withCenterLabels,
-	    	font, subtrack->ixColor, vis, subtrack->shortLabel, subtrack->graphUpperLimit,
-		subtrack->graphLowerLimit, TRUE);
+	    if (vis == tvDense)
+	        {
+		/* Avoid wigLeftAxisLabels here because it will repeatedly add center label 
+		 * offsets, and in dense mode we will only draw the one label. */
+		hvGfxTextRight(hvg, xOff, y, width - 1, height, subtrack->ixColor, font, 
+			subtrack->shortLabel);
+		}
+	    else
+		{
+		wigLeftAxisLabels(subtrack, seqStart, seqEnd, hvg, xOff, y, width, height, 
+			withCenterLabels, font, subtrack->ixColor, vis, subtrack->shortLabel, 
+			subtrack->graphUpperLimit, subtrack->graphLowerLimit, TRUE);
+		}
 	    y += height+1;
 	    }
 	}
     }
 }
 
 void multiWigLoadItems(struct track *track)
 /* Load multiWig items. */
 {
 containerLoadItems(track);
 struct track *subtrack;
 for (subtrack = track->subtracks; subtrack != NULL; subtrack = subtrack->next)
     {
     subtrack->mapsSelf = FALSE;	/* Round about way to tell wig not to do own mapping. */
     }