src/hg/hgTracks/hgTracks.c 1.1590

1.1590 2009/08/18 20:31:01 angie
When winEnd-winStart > trackDb setting maxWindowToDraw, inhibit the toggle-link over the message because toggling vis doesn't affect the image.
Index: src/hg/hgTracks/hgTracks.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTracks/hgTracks.c,v
retrieving revision 1.1589
retrieving revision 1.1590
diff -b -B -U 4 -r1.1589 -r1.1590
--- src/hg/hgTracks/hgTracks.c	17 Aug 2009 21:27:43 -0000	1.1589
+++ src/hg/hgTracks/hgTracks.c	18 Aug 2009 20:31:01 -0000	1.1590
@@ -1410,8 +1410,11 @@
 y += tHeight;
 return y;
 }
 
+// defined below:
+static int getMaxWindowToDraw(struct trackDb *tdb);
+
 int doTrackMap(struct track *track, struct hvGfx *hvg, int y, int fontHeight,
 	       int trackPastTabX, int trackPastTabWidth)
 /* Write out the map for this track. Return the new offset. */
 {
@@ -1457,8 +1460,10 @@
         if (tdbIsComposite(track->tdb))
             mapHeight = track->height;
         else
             mapHeight = track->lineHeight;
+	int maxWinToDraw = getMaxWindowToDraw(track->tdb);
+	if (maxWinToDraw <= 1 || (winEnd - winStart) <= maxWinToDraw)
         mapBoxToggleVis(hvg, trackPastTabX, y, trackPastTabWidth, mapHeight, track);
         y += mapHeight;
         break;
     case tvHide: