8c7448e77d08d38806a09f4643633f1d48f6beb7
braney
  Tue Oct 24 15:32:15 2017 -0700
some tweaks to custom composites so they play better as multiwigs

diff --git src/hg/hgTracks/multiWig.c src/hg/hgTracks/multiWig.c
index 8094afe..4ceb6d5 100644
--- src/hg/hgTracks/multiWig.c
+++ src/hg/hgTracks/multiWig.c
@@ -2,30 +2,31 @@
 
 /* Copyright (C) 2014 The Regents of the University of California 
  * See README in this or parent directory for licensing information. */
 
 #include "common.h"
 #include "hash.h"
 #include "linefile.h"
 #include "jksql.h"
 #include "dystring.h"
 #include "hdb.h"
 #include "hgTracks.h"
 #include "container.h"
 #include "wiggle.h"
 #include "wigCommon.h"
 #include "hui.h"
+#include "customComposite.h"
 
 struct floatPic
 /* A picture that stores RGB values in floating point. */
     {
     float **lines;   /* points to start of each line of image */
     float *image;
     int width;	/* Width in pixels. */
     int height; /* Heigh in pixels. */
     };
 
 struct floatPic *floatPicNew(int width, int height)
 /* Return a new floatPic. */
 {
 long lineSize = 3L * width;
 long imageSize = lineSize * height;
@@ -482,41 +483,50 @@
     Color yellow = hvGfxFindRgb(hvg, &undefinedYellowColor);
     hvGfxBox(hvg, fullInsideX, yOff, fullInsideWidth, tg->height, yellow);
     hvGfxUnclip(hvg);
     hvGfxSetClip(hvg, clipXBak, clipYBak, clipWidthBak, clipHeightBak);
     }
 
 struct wigCartOptions *wigCart = tg->wigCartData;
 struct wigGraphOutput *wgo = tg->wigGraphOutput;
 
 if (wigCart->aggregateFunction == wiggleAggregateAdd || wigCart->aggregateFunction == wiggleAggregateSubtract)
     {
     mergeWiggles(tg->subtracks, wigCart->aggregateFunction == wiggleAggregateAdd);
     tg->subtracks->next = NULL;
     }
 int numTrack = 0;
+boolean customComposite = FALSE;
+if (isCustomComposite(tg->tdb))
+    customComposite = TRUE;
+
 for (subtrack = tg->subtracks; subtrack != NULL; subtrack = subtrack->next)
     {
     if (isSubtrackVisible(subtrack))
 	{
         if (!subtrack->networkErrMsg || !errMsgShown)
 	    {
 	    if (subtrack->networkErrMsg)
 	       errMsgShown = TRUE;
 	    wgo->numTrack = numTrack++;
 	    subtrack->wigGraphOutput = wgo;
-	    int height = subtrack->totalHeight(subtrack, vis);
+            int height;
+            if (customComposite)
+                height = tg->totalHeight(tg, vis);
+            else
+                height = subtrack->totalHeight(subtrack, vis);
+
 	    hvGfxSetClip(hvg, xOff, y, width, height);
 	    if (wigCart->aggregateFunction != wiggleAggregateNone)
 		subtrack->lineHeight = tg->lineHeight;
 	    subtrack->drawItems(subtrack, seqStart, seqEnd, hvg, xOff, y, width, font, color, vis);
 	    if (wigCart->aggregateFunction == wiggleAggregateNone)
 		{
 		y += height + 1;
 		wgo->yOff = y;
 		}
 	    hvGfxUnclip(hvg);
 	    }
 	}
     }
 
 if (wigCart->aggregateFunction == wiggleAggregateTransparent)