src/hg/hgTracks/wigTrack.c 1.110
1.110 2010/05/20 19:52:32 kent
Making variable x to hold x1+xOff.
Index: src/hg/hgTracks/wigTrack.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTracks/wigTrack.c,v
retrieving revision 1.109
retrieving revision 1.110
diff -b -B -U 4 -r1.109 -r1.110
--- src/hg/hgTracks/wigTrack.c 13 May 2010 21:42:02 -0000 1.109
+++ src/hg/hgTracks/wigTrack.c 20 May 2010 19:52:32 -0000 1.110
@@ -797,8 +797,9 @@
* are all the same height in a run.
*/
for (x1 = 0; x1 < width; ++x1)
{
+ int x = x1 + xOff;
int preDrawIndex = x1 + preDrawZero;
struct preDrawElement *p = &preDraw[preDrawIndex];
Color drawColor = colorArray[x1];
@@ -847,41 +848,41 @@
if (dataValue < 0)
{
int scaledMin = scaleHeightToPixels(p->min);
int boxHeight = max(1,scaledMin-zeroPos);
- hvGfxBox(hvg, x1+xOff,zeroPos,1, boxHeight, lightColor);
+ hvGfxBox(hvg, x,zeroPos,1, boxHeight, lightColor);
if (!isnan(std))
{ // Test needed due to bug in version 1.5 bigWiles
int scaledMinus = scaleHeightToPixels(dataValue-std);
int boxHeight = max(1,scaledMinus-zeroPos);
- hvGfxBox(hvg, x1+xOff, zeroPos, 1, boxHeight, mediumColor);
+ hvGfxBox(hvg, x, zeroPos, 1, boxHeight, mediumColor);
}
boxHeight = max(1,scaledVal - zeroPos);
if (zeroPos == (yOff+h)) // bottom pixel special case
zeroPos -= 1;
if (((zeroPos-yOff)+boxHeight) == 0)
boxHeight += 1; // top pixel special case
- hvGfxBox(hvg, x1+xOff, zeroPos,1, boxHeight, drawColor);
+ hvGfxBox(hvg, x, zeroPos,1, boxHeight, drawColor);
}
else
{
int scaledMax = scaleHeightToPixels(p->max);
if (scaledMax == (h+yOff))
scaledMax = (h+yOff) - 1;
int boxHeight = max(1,zeroPos-scaledMax);
- hvGfxBox(hvg,x1+xOff,scaledMax,1,boxHeight, lightColor);
+ hvGfxBox(hvg,x,scaledMax,1,boxHeight, lightColor);
if (!isnan(std))
{ // Test needed due to bug in version 1.5 bigWiles
int scaledPlus = scaleHeightToPixels(dataValue+std);
int boxHeight = max(1,zeroPos-scaledPlus);
- hvGfxBox(hvg, x1+xOff, scaledPlus, 1, boxHeight, mediumColor);
+ hvGfxBox(hvg, x, scaledPlus, 1, boxHeight, mediumColor);
}
boxHeight = max(1,zeroPos - scaledVal);
if (scaledVal == (yOff+h)) // bottom pixel special case
scaledVal -= 1;
if (((scaledVal-yOff)+boxHeight) == 0)
boxHeight += 1; // top pixel special case
- hvGfxBox(hvg,x1+xOff,scaledVal,1, boxHeight, drawColor);
+ hvGfxBox(hvg,x,scaledVal,1, boxHeight, drawColor);
}
}
else
{
@@ -899,9 +900,9 @@
// negative data value exactly equal to top pixel
// make sure it draws something
if ((boxTop+boxHeight) == 0)
boxHeight += 1;
- hvGfxBox(hvg,x1+xOff, yOff+boxTop, 1, boxHeight, drawColor);
+ hvGfxBox(hvg,x, yOff+boxTop, 1, boxHeight, drawColor);
}
}
else
{ /* draw a 3 pixel height box */
@@ -909,31 +910,31 @@
{
int scaledMin = scaleHeightToPixels(p->min);
int scaledMax = scaleHeightToPixels(p->max);
int boxHeight = max(1,scaledMin - scaledMax);
- hvGfxBox(hvg, x1+xOff, scaledMax, 1, boxHeight, lightColor);
+ hvGfxBox(hvg, x, scaledMax, 1, 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 scaledMeanPlus = scaleHeightToPixels(dataValue+std);
int scaledMeanMinus = scaleHeightToPixels(dataValue-std);
int boxHeight = max(1,scaledMeanMinus - scaledMeanPlus);
- hvGfxBox(hvg, x1+xOff, scaledMeanPlus, 1,
+ hvGfxBox(hvg, x, scaledMeanPlus, 1,
boxHeight, mediumColor);
}
- hvGfxBox(hvg, x1+xOff, scaledMean, 1, 1, drawColor);
+ hvGfxBox(hvg, x, scaledMean, 1, 1, drawColor);
}
else
{
int yPointGraph = scaleHeightToPixels(dataValue) - 1;
- hvGfxBox(hvg, x1+xOff, yPointGraph, 1, 3, drawColor);
+ hvGfxBox(hvg, x, yPointGraph, 1, 3, drawColor);
}
}
if (dataValue > graphUpperLimit)
- hvGfxBox(hvg, x1+xOff, yOff, 1, 2, clipColor);
+ hvGfxBox(hvg, x, yOff, 1, 2, clipColor);
else if (dataValue < graphLowerLimit)
- hvGfxBox(hvg, x1+xOff, yOff + h - 1, 1, 2, clipColor);
+ hvGfxBox(hvg, x, yOff + h - 1, 1, 2, clipColor);
#undef scaleHeightToPixels /* No longer use this symbol */
} /* vis == tvFull || vis == tvPack */
else if (vis == tvDense || vis == tvSquish)
{
@@ -945,10 +946,9 @@
grayIndex = ((grayValue-graphLowerLimit)/graphRange)*MAX_WIG_VALUE;
drawColor =
tg->colorShades[grayInRange(grayIndex, 0, MAX_WIG_VALUE)];
- hvGfxBox(hvg, x1+xOff, yOff, 1,
- tg->lineHeight, drawColor);
+ hvGfxBox(hvg, x, yOff, 1, tg->lineHeight, drawColor);
} /* vis == tvDense || vis == tvSquish */
} /* if (preDraw[].count) */
} /* for (x1 = 0; x1 < width; ++x1) */
} /* graphPreDraw() */