src/hg/instinct/hgBamBam/drawingCode.c 1.7

1.7 2010/06/01 04:00:48 jsanborn
minor update
Index: src/hg/instinct/hgBamBam/drawingCode.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/instinct/hgBamBam/drawingCode.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -b -B -U 4 -r1.6 -r1.7
--- src/hg/instinct/hgBamBam/drawingCode.c	31 May 2010 03:02:21 -0000	1.6
+++ src/hg/instinct/hgBamBam/drawingCode.c	1 Jun 2010 04:00:48 -0000	1.7
@@ -678,8 +678,18 @@
 int medY = round((float) settings->dataHeight * (1.0 - medVal) ) + settings->dataOffsetY;
 
 vgSetClip(vg, settings->dataOffsetX, 0, settings->dataWidth, settings->height);
 
+if (settings->maxVal == FLOAT_NULL)
+    {
+    for (hm = hmList; hm; hm = hm->next)
+	{
+	val = hm->val / hm->count;
+	if (val > settings->maxVal)
+	    settings->maxVal = val;
+	}
+    }
+
 for (hm = hmList; hm ; hm = hm->next)
     {
     val = hm->val / hm->count;
     val = val / (settings->maxVal - settings->minVal);