f4a6e625d1992c8ca56a24bada941dda284a4c53 braney Fri Jun 10 12:24:41 2016 -0700 draw feet in long-range mode #15232 diff --git src/hg/hgTracks/longRangeTrack.c src/hg/hgTracks/longRangeTrack.c index 8a7597e..21e9f14 100644 --- src/hg/hgTracks/longRangeTrack.c +++ src/hg/hgTracks/longRangeTrack.c @@ -35,30 +35,34 @@ for(longRange=longRangeList; longRange; longRange=longRange->next) { safef(itemBuf, sizeof itemBuf, "%d", longRange->id); safef(statusBuf, sizeof statusBuf, "%g %s:%d %s:%d", longRange->score, longRange->sChrom, longRange->s, longRange->eChrom, longRange->e); boolean sOnScreen = (longRange->s >= seqStart) && (longRange->s < seqEnd); unsigned sx = 0, ex = 0; if (sOnScreen) sx = (longRange->s - seqStart) * scale + xOff; if (differentString(longRange->sChrom, longRange->eChrom)) { if (!sOnScreen) continue; + // draw the foot + int footWidth = scale * (longRange->sw / 2); + hvGfxLine(hvg, sx - footWidth, yOff, sx + footWidth, yOff, MG_BLUE); + int height = tg->height/2; if (tg->visibility == tvDense) height = tg->height; unsigned yPos = yOff + height; hvGfxLine(hvg, sx, yOff, sx, yPos, MG_BLUE); if (tg->visibility == tvFull) { mapBoxHgcOrHgGene(hvg, longRange->s, longRange->s, sx - 2, yOff, 4, tg->height/2, tg->track, itemBuf, statusBuf, NULL, TRUE, NULL); safef(buffer, sizeof buffer, "%s:%d", longRange->eChrom, longRange->e); hvGfxTextCentered(hvg, sx, yPos + 2, 4, 4, MG_BLUE, font, buffer); int width = vgGetFontStringWidth(hvg->vg, font, buffer); int height = vgGetFontPixelHeight(hvg->vg, font); mapBoxHgcOrHgGene(hvg, longRange->s, longRange->s, sx - width/2, yPos, width, height, @@ -68,33 +72,41 @@ else { boolean eOnScreen = (longRange->e >= seqStart) && (longRange->e < seqEnd); if (!(sOnScreen || eOnScreen)) continue; if (eOnScreen) ex = (longRange->e - seqStart) * scale + xOff; double longRangeWidth = longRange->e - longRange->s; int peak = (tg->height - 15) * ((double)longRangeWidth / maxWidth) + yOff + 10; if (tg->visibility == tvDense) peak = yOff + tg->height; if (sOnScreen) + { + int footWidth = scale * (longRange->sw / 2); + hvGfxLine(hvg, sx - footWidth, yOff, sx + footWidth, yOff, color); hvGfxLine(hvg, sx, yOff, sx, peak, color); + } if (eOnScreen) + { + int footWidth = scale * (longRange->ew / 2); + hvGfxLine(hvg, ex - footWidth, yOff, ex + footWidth, yOff, color); hvGfxLine(hvg, ex, yOff, ex, peak, color); + } if (tg->visibility == tvFull) { unsigned sPeak = sOnScreen ? sx : xOff; unsigned ePeak = eOnScreen ? ex : xOff + width; hvGfxLine(hvg, sPeak, peak, ePeak, peak, color); safef(statusBuf, sizeof statusBuf, "%g %s:%d %s:%d", longRange->score, longRange->sChrom, longRange->s, longRange->eChrom, longRange->e); if (sOnScreen) mapBoxHgcOrHgGene(hvg, longRange->s, longRange->e, sx - 2, yOff, 4, peak - yOff, tg->track, itemBuf, statusBuf, NULL, TRUE, NULL); if (eOnScreen) mapBoxHgcOrHgGene(hvg, longRange->s, longRange->e, ex - 2, yOff, 4, peak - yOff, tg->track, itemBuf, statusBuf, NULL, TRUE, NULL);