48123b8bfcac353f062a5a03d4c361720628850b
braney
  Thu Mar 23 09:44:53 2017 -0700
fix code that wasn't grabbing trackDb settings correctly

diff --git src/hg/hgTracks/simpleTracks.c src/hg/hgTracks/simpleTracks.c
index 0d48afb..19a871e 100644
--- src/hg/hgTracks/simpleTracks.c
+++ src/hg/hgTracks/simpleTracks.c
@@ -4499,33 +4499,37 @@
 
 if (countsPerPixel <= 1.0)
     countsToPixelsUp(counts, pre);
 else
     countsToPixelsDown(counts, pre);
 }
 
 static void genericDrawItemsWiggle(struct track *tg, int seqStart, int seqEnd,
                                        struct hvGfx *hvg, int xOff, int yOff, int width,
                                        MgFont *font, Color color, enum trackVisibility vis)
 /* Draw a list of linked features into a wiggle. */
 {
 struct wigCartOptions *wigCart = tg->wigCartData;
 struct preDrawContainer *pre = tg->preDrawContainer = initPreDrawContainer(insideWidth);
 struct trackDb *tdb = tg->tdb;
-if (hashFindVal(tdb->settingsHash, AUTOSCALE) == NULL)
+boolean parentLevel = isNameAtParentLevel(tdb,tdb->track);
+
+char *autoScale = cartOptionalStringClosestToHome(cart, tdb, parentLevel, AUTOSCALE);
+if (autoScale == NULL)
     wigCart->autoScale =  wiggleScaleAuto;
-if (hashFindVal(tdb->settingsHash, WINDOWINGFUNCTION) == NULL)
+char *windowingFunction = cartOptionalStringClosestToHome(cart, tdb, parentLevel, WINDOWINGFUNCTION);
+if (windowingFunction == NULL)
     wigCart->windowingFunction = wiggleWindowingMax;
 unsigned *counts = countOverlaps(tg);
 
 countsToPixels(counts, pre);
 freez(&counts);
 
 tg->colorShades = shadesOfGray;
 hvGfxSetClip(hvg, insideX, yOff, insideWidth, tg->height);
 tg->mapsSelf = FALSE; // some magic to turn off the link out
 wigPreDrawPredraw(tg, seqStart, seqEnd, hvg, xOff, yOff, width, font, color, vis,
 	       tg->preDrawContainer, tg->preDrawContainer->preDrawZero, tg->preDrawContainer->preDrawSize, &tg->graphUpperLimit, &tg->graphLowerLimit);
 wigDrawPredraw(tg, seqStart, seqEnd, hvg, xOff, yOff, width, font, color, vis,
 	       tg->preDrawContainer, tg->preDrawContainer->preDrawZero, tg->preDrawContainer->preDrawSize, tg->graphUpperLimit, tg->graphLowerLimit);
 tg->mapsSelf = TRUE;
 hvGfxUnclip(hvg);