9541d6fe625ba586dd48f5da684ef633df4d580e
braney
  Wed Apr 23 12:40:32 2014 -0700
make stacked wiggles work in point mode
diff --git src/hg/hgTracks/wigTrack.c src/hg/hgTracks/wigTrack.c
index 05afa3c..957c23c 100644
--- src/hg/hgTracks/wigTrack.c
+++ src/hg/hgTracks/wigTrack.c
@@ -1018,31 +1018,34 @@
 		    int boxHeight = max(1,scaledMin - scaledMax);
 		    vLine(image, x, scaledMax, boxHeight, lightColor);
 		    int scaledMean = scaleHeightToPixels(dataValue);
 		    double std = calcStdFromSums(p->sumData, p->sumSquares, p->count);
 		    if (!isnan(std))  // Test needed because of bug in version 1.5 bigWiles
 			{
 			int scaledPlus = scaleHeightToPixels(doTransform(mean+std, transformFunc));
 			int scaledMinus = scaleHeightToPixels(doTransform(mean-std, transformFunc));
 			int boxHeight = max(1,scaledMinus - scaledPlus);
 			vLine(image, x, scaledPlus, boxHeight, mediumColor);
 			}
 		    vLine(image, x, scaledMean, 1, drawColor);
 		    }
 		else
 		    {
-		    int yPointGraph = scaleHeightToPixels(dataValue) - 1;
+		    double y0 = dataValue;
+		    if ((yOffsets != NULL) && (numTrack > 0))
+			y0 += yOffsets[(numTrack-1) *  width + x1];
+		    int yPointGraph = scaleHeightToPixels(y0) - 1;
 		    vLine(image, x, yPointGraph, 3, drawColor);
 		    }
 		}
 	    if (dataValue > graphUpperLimit)
 		vLine(image, x, yOff, 2, clipColor);
 	    else if (dataValue < graphLowerLimit)
 		vLine(image, x, yOff + h - 1, 2, clipColor);
 #undef scaleHeightToPixels	/* No longer use this symbol */
             }   /*	vis == tvFull || vis == tvPack */
         else if (vis == tvDense || vis == tvSquish)
 	    {
 	    double grayValue;
 	    int grayIndex;
 	    /* honor the viewLimits, data below is white, data above is black */
 	    grayValue = max(dataValue,graphLowerLimit);