7e39c3c7fae1117046499052633eaf0be9885ad3 tdreszer Wed Aug 17 15:53:05 2011 -0700 Code that is ifdef'd out for >1x dragScroll. diff --git src/hg/hgTracks/simpleTracks.c src/hg/hgTracks/simpleTracks.c index 21e37af..4ffd0bb 100644 --- src/hg/hgTracks/simpleTracks.c +++ src/hg/hgTracks/simpleTracks.c @@ -2852,31 +2852,30 @@ if(!theImgBox || tg->limitedVis != tvDense || !tdbIsCompositeChild(tg->tdb)) { char *directUrl = trackDbSetting(tg->tdb, "directUrl"); boolean withHgsid = (trackDbSetting(tg->tdb, "hgsid") != NULL); mapBoxHgcOrHgGene(hvg, start, end, x, y, width, height, tg->track, mapItemName, itemName, directUrl, withHgsid, NULL); } } void genericDrawNextItemStuff(struct track *tg, struct hvGfx *hvg, enum trackVisibility vis, struct slList *item, int x2, int textX, int y, int heightPer, boolean snapLeft, Color color) /* After the item is drawn in genericDrawItems, draw next/prev item related */ /* buttons and the corresponding mapboxes. */ { -int trackPastTabX = (withLeftLabels ? trackTabWidth : 0); int buttonW = heightPer-1 + 2*NEXT_ITEM_ARROW_BUFFER; int s = tg->itemStart(tg, item); int e = tg->itemEnd(tg, item); boolean rButton = FALSE; boolean lButton = FALSE; /* Draw the actual triangles. These are always at the edge of the window. */ if (s < winStart) { lButton = TRUE; hvGfxNextItemButton(hvg, insideX + NEXT_ITEM_ARROW_BUFFER, y, heightPer-1, heightPer-1, color, MG_WHITE, FALSE); } if (e > winEnd) { rButton = TRUE; @@ -2914,39 +2913,42 @@ { tg->mapItem(tg, hvg, item, tg->itemName(tg, item), tg->mapItemName(tg, item), s, e, textX, y, w - buttonW, heightPer); tg->nextPrevExon(tg, hvg, item, x2-buttonW, y, buttonW, heightPer, TRUE); } else tg->mapItem(tg, hvg, item, tg->itemName(tg, item), tg->mapItemName(tg, item), s, e, textX, y, w, heightPer); } /* Full mode is a little easier to deal with. */ else if (vis == tvFull) { int geneMapBoxX = insideX; int geneMapBoxW = insideWidth; /* Draw the first gene mapbox, in the left margin. */ +#ifndef IMAGEv2_NO_LEFTLABEL_ON_FULL + int trackPastTabX = (withLeftLabels ? trackTabWidth : 0); #ifdef IMAGEv2_SHORT_MAPITEMS char *name = tg->itemName(tg, item); if (*name != '\0') tg->mapItem(tg, hvg, item, name, tg->mapItemName(tg, item), s, e, trackPastTabX, y, insideX - trackPastTabX, heightPer); #else///ndef IMAGEv2_SHORT_MAPITEMS tg->mapItem(tg, hvg, item, tg->itemName(tg, item), tg->mapItemName(tg, item), s, e, trackPastTabX, y, insideX - trackPastTabX, heightPer); #endif///ndef IMAGEv2_SHORT_MAPITEMS +#endif///ndef IMAGEv2_NO_LEFTLABEL_ON_FULL /* Make the button mapboxes. */ if (lButton) tg->nextPrevExon(tg, hvg, item, insideX, y, buttonW, heightPer, FALSE); if (rButton) tg->nextPrevExon(tg, hvg, item, insideX + insideWidth - buttonW, y, buttonW, heightPer, TRUE); /* Depending on which button mapboxes we drew, draw the remaining mapbox. */ if (lButton && rButton) { geneMapBoxX += buttonW; geneMapBoxW -= 2 * buttonW; } else if (lButton) { geneMapBoxX += buttonW; geneMapBoxW -= buttonW; @@ -3038,35 +3040,35 @@ int y = yOff + tg->lineHeight * sn->row; tg->drawItemAt(tg, item, hvg, xOff, y, scale, font, color, vis); /* pgSnp tracks may change flags between items */ withLabels = (withLeftLabels && withIndividualLabels && (vis == tvPack) && !tg->drawName); if (withLabels) { int nameWidth = mgFontStringWidth(font, name); int dotWidth = tl.nWidth/2; boolean snapLeft = FALSE; boolean drawNameInverted = highlightItem(tg, item); textX -= nameWidth + dotWidth; snapLeft = (textX < insideX); /* Special tweak for expRatio in pack mode: force all labels * left to prevent only a subset from being placed right: */ snapLeft |= (startsWith("expRatio", tg->tdb->type)); -#if defined(IMAGEv2_DRAG_SCROLL_SZ) && (IMAGEv2_DRAG_SCROLL_SZ > 1) +#ifdef IMAGEv2_NO_LEFTLABEL_ON_FULL if (theImgBox == NULL && snapLeft) -#else///if !defined(IMAGEv2_DRAG_SCROLL_SZ) || (IMAGEv2_DRAG_SCROLL_SZ <= 1) +#else///ifndef IMAGEv2_NO_LEFTLABEL_ON_FULL if (snapLeft) /* Snap label to the left. */ -#endif /// !defined(IMAGEv2_DRAG_SCROLL_SZ) || (IMAGEv2_DRAG_SCROLL_SZ <= 1) +#endif ///ndef IMAGEv2_NO_LEFTLABEL_ON_FULL { textX = leftLabelX; assert(hvgSide != NULL); hvGfxUnclip(hvgSide); hvGfxSetClip(hvgSide, leftLabelX, yOff, insideWidth, tg->height); if(drawNameInverted) { int boxStart = leftLabelX + leftLabelWidth - 2 - nameWidth; hvGfxBox(hvgSide, boxStart, y, nameWidth+1, tg->heightPer - 1, color); hvGfxTextRight(hvgSide, leftLabelX, y, leftLabelWidth-1, tg->heightPer, MG_WHITE, font, name); } else hvGfxTextRight(hvgSide, leftLabelX, y, leftLabelWidth-1, tg->heightPer, labelColor, font, name); @@ -3152,45 +3154,45 @@ tg->drawItemAt(tg, item, hvg, xOff, y, scale, font, color, vis); if (vis == tvFull) { /* The doMapItems will make the mapboxes normally but make */ /* them here if we're drawing nextItem buttons. */ if (nextItemCompatible(tg)) #ifdef IMAGEv2_SHORT_MAPITEMS { // Convert start/end coordinates to pix int s = tg->itemStart(tg, item); int e = tg->itemEnd(tg, item); int sClp = (s < winStart) ? winStart : s; int eClp = (e > winEnd) ? winEnd : e; int x1 = round((sClp - winStart)*scale) + xOff; int x2 = round((eClp - winStart)*scale) + xOff; - #if defined(IMAGEv2_DRAG_SCROLL_SZ) && (IMAGEv2_DRAG_SCROLL_SZ > 1) + #ifdef IMAGEv2_NO_LEFTLABEL_ON_FULL if (theImgBox != NULL && vis == tvFull) // dragScroll >1x has no bed full leftlabels, { // but in image labels like pack. char *name = tg->itemName(tg, item); int nameWidth = mgFontStringWidth(font, name); int textX = round((s - winStart)*scale) + xOff; textX -= (nameWidth + 2); if (textX >= insideX && nameWidth > 0) { x1 = textX; // extends the map item to cover this label Color itemNameColor = tg->itemNameColor(tg, item, hvg); hvGfxTextRight(hvg,textX,y,nameWidth,tg->heightPer,itemNameColor,font,name); } } - #endif /// defined(IMAGEv2_DRAG_SCROLL_SZ) && (IMAGEv2_DRAG_SCROLL_SZ > 1) + #endif ///def IMAGEv2_NO_LEFTLABEL_ON_FULL genericDrawNextItemStuff(tg, hvg, vis, item, x2, x1, y, tg->heightPer, FALSE,color); } #else//ifndef IMAGEv2_SHORT_MAPITEMS genericDrawNextItemStuff(tg, hvg, vis, item, -1, -1, y, tg->heightPer, FALSE, color); #endif//ndef IMAGEv2_SHORT_MAPITEMS y += tg->lineHeight; } } } void genericDrawItems(struct track *tg, int seqStart, int seqEnd, struct hvGfx *hvg, int xOff, int yOff, int width, MgFont *font, Color color, enum trackVisibility vis)