b68693a185e6d68effc8d3371d509e0a0c7e7981
tdreszer
  Mon Sep 13 09:41:22 2010 -0700
Support conditional center labels for dense subtracks in both C and JS. Top dense subtrack in a set will show centerLabel of composite.
diff --git src/hg/hgTracks/simpleTracks.c src/hg/hgTracks/simpleTracks.c
index 340b2e8..dc21549 100644
--- src/hg/hgTracks/simpleTracks.c
+++ src/hg/hgTracks/simpleTracks.c
@@ -564,7 +564,7 @@
 boolean isWithCenterLabels(struct track *track)
 /* Cases: only TRUE when global withCenterLabels is TRUE
  * If track->tdb has a centerLabelDense setting, go with it.
- * If composite child then no center labels in dense mode. */
+// * If composite child then no center labels in dense mode. */
 {
 if(!withCenterLabels)
     return FALSE;
@@ -575,12 +575,21 @@
         {
         return sameWord(centerLabelsDense, "on");
         }
-    if ((limitVisibility(track) == tvDense) && tdbIsCompositeChild(track->tdb))
-	   return FALSE;
     }
 return withCenterLabels;
 }
 
+boolean isCenterLabelConditionallySeen(struct track *track)
+// returns FALSE if track and prevTrack have same parent, and are both dense subtracks
+{
+if (isCenterLabelConditional(track))
+    {
+    if (track->prevTrack && track->parent == track->prevTrack->parent && isCenterLabelConditional(track->prevTrack))
+        return FALSE;
+    }
+return isWithCenterLabels(track);
+}
+
 void mapStatusMessage(char *format, ...)
 /* Write out stuff that will cause a status message to
  * appear when the mouse is over this box. */