38f76a98fd4df99ad172c8713df10546ba119f3d kate Sun Sep 23 21:23:09 2018 -0700 In merged pack mode, distinguish target further by drawing in contrasting color (black if useColor on). refs #21917 diff --git src/hg/hgTracks/interactTrack.c src/hg/hgTracks/interactTrack.c index 0aa1f03..8e80d08 100644 --- src/hg/hgTracks/interactTrack.c +++ src/hg/hgTracks/interactTrack.c @@ -676,38 +676,50 @@ ellipseOrient = ELLIPSE_TOP; yLeft = yOff + tg->height - peakHeight; yTop = yOff + tg->height + peakHeight; } hvGfxEllipseDraw(hvg, lowerX, yLeft, upperX, yTop, color, ellipseOrient, isReversed && doDashes); // draw grab box and map box on peak int maxY = peakHeight + yOff; int peakX = ((upperX - lowerX + 1) / 2) + lowerX; drawPeakMapbox(tg, hvg, inter->chromStart, inter->chromEnd, inter->name, statusBuf, peakX, maxY, peakColor, highlightColor, drawUp); } } } +void interactLinkedFeaturesDrawAt(struct track *tg, void *item, + struct hvGfx *hvg, int xOff, int y, double scale, + MgFont *font, Color color, enum trackVisibility vis) +/* Draw a item with target in contrasting color */ +{ +linkedFeaturesDrawAt(tg, item, hvg, xOff, y, scale, font, color, vis); + +struct linkedFeatures *lf = item; +// TODO: use magenta if track isn't colored ? +drawScaledBox(hvg, lf->tallStart, lf->tallEnd, scale, xOff, y, tg->heightPer, MG_BLACK); +} + void interactDrawItems(struct track *tg, int seqStart, int seqEnd, struct hvGfx *hvg, int xOff, int yOff, int width, MgFont *font, Color color, enum trackVisibility vis) /* Draw a list of interact structures. */ { if (isBedMode(tg)) { - tg->drawItemAt = linkedFeaturesDrawAt; + tg->drawItemAt = interactLinkedFeaturesDrawAt; linkedFeaturesDraw(tg, seqStart, seqEnd, hvg, xOff, yOff, width, font, color, vis); } else drawInteractItems(tg, seqStart, seqEnd, hvg, xOff, yOff, width, font, color, vis); } void interactMethods(struct track *tg) /* Interact track type methods */ { tg->bedSize = 12; linkedFeaturesMethods(tg); // for pack and squish modes tg->loadItems = interactLoadItems; tg->drawItems = interactDrawItems; }