ef7e53bd098a62ded05b8c3a08afff08ff939063 kate Wed Aug 8 16:26:40 2018 -0700 Minor changes to make it easier to see/mouseover/click on the interactions: 1) Darken color of grab box. 2) Make endpoint horizontals 2 pixels high (JK suggestion). refs #21109 diff --git src/hg/hgTracks/interactTrack.c src/hg/hgTracks/interactTrack.c index a6b1a28..f770776 100644 --- src/hg/hgTracks/interactTrack.c +++ src/hg/hgTracks/interactTrack.c @@ -235,60 +235,60 @@ // Get spectrum range int scoreMin = atoi(trackDbSettingClosestToHomeOrDefault(tg->tdb, "scoreMin", "0")); int scoreMax = atoi(trackDbSettingClosestToHomeOrDefault(tg->tdb, "scoreMax", "1000")); // Draw items for (inter = (struct interact *)tg->items; inter; inter = inter->next) { char *otherChrom = interactOtherChrom(inter); safef(itemBuf, sizeof itemBuf, "%s", inter->name); char *statusBuf = interactMouseover(inter, otherChrom); // Pick colors #define MG_LIGHT_MAGENTA 0xffffbbff - #define MG_LIGHT_GRAY 0xffbbbbbb + #define MG_LIGHT_GRAY 0xff909090 color = interactItemColor(tg, inter, hvg, scoreMin, scoreMax); if (vis == tvDense && otherChrom && color == MG_BLACK) // use highlight color for other chrom items in dense mode color = MG_LIGHT_MAGENTA; int peakColor = (color == MG_BLACK || tg->colorShades) ? MG_LIGHT_MAGENTA : MG_LIGHT_GRAY; if (otherChrom) { // different chromosomes // draw below same chrom items, if any int height = 0; int yOffOther = yOff; if (vis == tvDense) { height = tg->height; } else { height = tInfo->otherHeight/2; yOffOther = yOff + tInfo->sameHeight; } unsigned r = interactRegionCenter(inter->chromStart, inter->chromEnd); int x = getX(r, seqStart, scale, xOff); int footWidth = regionFootWidth(inter->chromStart, inter->chromEnd, scale); unsigned yPos = yOffOther + height; - // draw the foot - hvGfxLine(hvg, x - footWidth, yOffOther, x + footWidth, yOffOther, color); + // draw the foot (2 pixels high) + hvGfxBox(hvg, x - footWidth, yOffOther, footWidth + footWidth + 1, 2, color); // draw the vertical if (tInfo->isDirectional && differentString(inter->chrom, inter->sourceChrom)) hvGfxDottedLine(hvg, x, yOffOther, x, yPos, color, TRUE); else hvGfxLine(hvg, x, yOffOther, x, yPos, color); if (vis == tvDense) continue; // add map box to foot char *nameBuf = (inter->chromStart == inter->sourceStart ? inter->sourceName : inter->targetName); if (isEmptyTextField(nameBuf)) nameBuf = statusBuf; @@ -330,45 +330,45 @@ int tX = getX(t, seqStart, scale, xOff); int tWidth = regionFootWidth(inter->targetStart,inter->targetEnd, scale); boolean tOnScreen = (t >= seqStart) && (t< seqEnd); boolean isReversed = (tInfo->isDirectional && t < s); int interSize = abs(t - s); int peakHeight = (tInfo->sameHeight - 15) * ((double)interSize / tInfo->maxSize) + 10; int peak = yOff + peakHeight; if (vis == tvDense) peak = yOff + tg->height; // NOTE: until time permits, force to rectangle when in reversed strand mode. if (sOnScreen) { - // draw foot of source region - hvGfxLine(hvg, sX - sWidth, yOff, sX + sWidth, yOff, color); + // draw foot of source region (2 pixels high) + hvGfxBox(hvg, sX - sWidth, yOff, sWidth + sWidth + 1, 2, color); if (vis == tvDense || !tOnScreen || draw == DRAW_LINE || hvg->rc) { // draw vertical if (isReversed) hvGfxDottedLine(hvg, sX, yOff, sX, peak, color, TRUE); else hvGfxLine(hvg, sX, yOff, sX, peak, color); } } if (tOnScreen) { - // draw foot of target region - hvGfxLine(hvg, tX - tWidth, yOff, tX + tWidth, yOff, color); + // draw foot of target region (2 pixels high) + hvGfxBox(hvg, tX - tWidth, yOff, tWidth + tWidth + 1, 2, color); if (vis == tvDense || !sOnScreen || draw == DRAW_LINE || hvg->rc) { // draw vertical if (isReversed) hvGfxDottedLine(hvg, tX, yOff, tX, peak, color, TRUE); else hvGfxLine(hvg, tX, yOff, tX, peak, color); } } if (vis == tvDense) continue; // Full mode: add map boxes and draw interaction int chromStart = inter->chromStart; int chromEnd = inter->chromEnd;