e3084c1bf7cea3aa7f2bbe90d298adbae603b5e2
braney
  Fri Oct 2 09:33:46 2026 -0700
hgTracks: keep the fraction when negateValues swaps a pixel's min and max, refs #38462

preDrawWindowFunction swapped min and max through an int, so the old min
lost its fraction on the way into the new max.  With mean+whiskers the top
whisker, and the autoscale upper limit, were then drawn at a whole number.

diff --git src/hg/hgTracks/wigTrack.c src/hg/hgTracks/wigTrack.c
index 708d0c05424..3cc63bd3fb6 100644
--- src/hg/hgTracks/wigTrack.c
+++ src/hg/hgTracks/wigTrack.c
@@ -647,31 +647,31 @@
 		break;
 	    default:
 	    case wiggleWindowingMax:
 		if (fabs(preDraw[i].min)
 			> fabs(preDraw[i].max))
 		    dataValue = preDraw[i].min;
                 else
 		    dataValue = preDraw[i].max;
 		break;
 	    }
 
 	dataValue = doTransform(dataValue, transformFunc);
 	if (doNegative)
 	    {
 	    dataValue = -dataValue;
-	    int swap = preDraw[i].min;
+	    double swap = preDraw[i].min;
 	    preDraw[i].min = -preDraw[i].max;
 	    preDraw[i].max = -swap;
 	    }
 	preDraw[i].plotValue = dataValue;
 	preDraw[i].smooth = dataValue;
 	}
     }
 }
 
 void preDrawSmoothing(struct preDrawElement *preDraw, int preDrawSize,
     enum wiggleSmoothingEnum smoothingWindow)
 /*      apply smoothing function to preDraw array       */
 {
 /*      Are we perhaps doing smoothing ?  smoothingWindow is 1 off due
  *      to enum funny business in inc/hui.h and lib/hui.c       */