src/hg/hgTracks/cds.c 1.94
1.94 2009/04/29 18:47:45 angie
Fixed another couple off-by-one problems with insertion lines on the right end of thick portion (thanks Brooke!).
Index: src/hg/hgTracks/cds.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTracks/cds.c,v
retrieving revision 1.93
retrieving revision 1.94
diff -b -B -U 4 -r1.93 -r1.94
--- src/hg/hgTracks/cds.c 28 Apr 2009 23:40:24 -0000 1.93
+++ src/hg/hgTracks/cds.c 29 Apr 2009 18:47:45 -0000 1.94
@@ -245,14 +245,17 @@
static void drawVertLine(struct linkedFeatures *lf, struct hvGfx *hvg,
int chromStart, int xOff, int y,
int height, double scale, Color color)
-/* Draw a 1-pixel wide vertical line at the given chromosomal coord. */
+/* Draw a 1-pixel wide vertical line at the given chromosomal coord.
+ * The line is 0 bases wide (chromStart==chromEnd) but that doesn't
+ * matter if we're zoomed out to >1base/pixel, so this is OK for diffs
+ * when zoomed way out and for insertion points at any scale. */
{
int thisX = round((double)(chromStart-winStart)*scale) + xOff;
int thisY = y;
int thisHeight = height;
-if ((chromStart < lf->tallStart) || (chromStart >= lf->tallEnd))
+if ((chromStart < lf->tallStart) || (chromStart > lf->tallEnd))
{
/* adjust for UTR. WARNING: this duplicates shortOff & shortHeight
* calculations in linkedFeaturesDrawAt */
thisY += height/4;
@@ -1543,9 +1546,9 @@
((polyASize + 3) >=
(psl->qSize -
(psl->qStarts[lastBlk] + psl->blockSizes[lastBlk]))))
{
- s = psl->tStarts[lastBlk] + psl->blockSizes[lastBlk] - 1;
+ s = psl->tStarts[lastBlk] + psl->blockSizes[lastBlk];
drawVertLine(lf, hvg, s, xOff, y, heightPer-1, scale,
cdsColor[CDS_POLY_A]);
gotPolyAEnd = TRUE;
}