b94c58d2a800d05e38fcc243571156a88600a2b7
larrym
  Wed Apr 18 16:49:28 2012 -0700
fix bug caused by assumption that limitedVis is always set (#7272)
diff --git src/hg/hgTracks/bigBedTrack.c src/hg/hgTracks/bigBedTrack.c
index 1805315..25bcf2a 100644
--- src/hg/hgTracks/bigBedTrack.c
+++ src/hg/hgTracks/bigBedTrack.c
@@ -42,42 +42,42 @@
     bbi = track->bbiFile = bigBedFileOpen(fileName);
     }
 return bbi;
 }
 
 struct bigBedInterval *bigBedSelectRange(struct track *track,
 	char *chrom, int start, int end, struct lm *lm)
 /* Return list of intervals in range. */
 {
 struct bigBedInterval *result = NULL;
 /* protect against temporary network error */
 struct errCatch *errCatch = errCatchNew();
 if (errCatchStart(errCatch))
     {
     struct bbiFile *bbi = fetchBbiForTrack(track);
-    if (track->limitedVis != tvDense)
+    if (actualVisibility(track) != tvDense)
 	{
 	int maxItems = maximumTrackItems(track) + 1;
 	result = bigBedIntervalQuery(bbi, chrom, start, end, maxItems, lm);
 	if (slCount(result) >= maxItems)
 	    {
 	    track->limitedVis = tvDense;
 	    track->limitedVisSet = TRUE;
 	    result = NULL;
 	    }
 	}
-    if (track->visibility == tvDense || track->limitedVis == tvDense)
+    if (actualVisibility(track) == tvDense)
 	{
 	AllocArray(track->summary, insideWidth);
 	if (bigBedSummaryArrayExtended(bbi, chrom, start, end, insideWidth, track->summary))
 	    {
 	    char *denseCoverage = trackDbSettingClosestToHome(track->tdb, "denseCoverage");
 	    if (denseCoverage != NULL)
 		{
 		double endVal = atof(denseCoverage);
 		if (endVal <= 0)
 		    {
 		    AllocVar(track->sumAll);
 		    *track->sumAll = bbiTotalSummary(bbi);
 		    }
 		}
 	    }