ec63f97739cc4b22e80a26a9db52e80416879d39
kate
  Wed Aug 29 15:48:37 2018 -0700
Refactor in preparation for flipped display. refs #21917

diff --git src/hg/hgTracks/interactTrack.c src/hg/hgTracks/interactTrack.c
index 4c1e0ed..f4d40fd 100644
--- src/hg/hgTracks/interactTrack.c
+++ src/hg/hgTracks/interactTrack.c
@@ -231,70 +231,67 @@
         if (labelStart <= prevLabelEnd && 
                 !(labelStart == prevLabelStart && labelEnd == prevLabelEnd && 
                     sameString(otherChrom, prevLabel)))
             tInfo->doOtherLabels = FALSE;
         prevLabelStart = labelStart;
         prevLabelEnd = labelEnd;
         prevLabel = otherChrom;
         }
     }
 tInfo->fontHeight = vgGetFontPixelHeight(hvg->vg, font);
 tInfo->otherHeight = (tInfo->otherCount) ? 3 * tInfo->fontHeight : 0;
 tInfo->sameHeight = (tInfo->sameCount) ? tg->height - tInfo->otherHeight : 0;
 return tInfo;
 }
 
-char *endpointClickArg(char *endpointName)
-/* Add var to identify endpoint ('foot'), or NULL if no name for endpoint */
-{
-if (isEmptyTextField(endpointName))
-    return NULL;
-char buf[256];
-safef(buf, sizeof(buf),"foot=%s", cgiEncode(endpointName));
-return(cloneString(buf));
-}
-
 void drawFoot(struct hvGfx *hvg, char *seq, int seqStart, int seqEnd, 
                             int x, int y, int width, Color color, struct hash *footHash)
 /* Draw interaction end, 2 pixels high.  Force to black if it exactly overlaps another */
 {
 char buf[256];
 safef(buf, sizeof(buf), "%s:%d-%d", seq, seqStart, seqEnd);
 char *pos = cloneString(buf);
 Color footColor = color;
 if (hashLookup(footHash, pos))
     footColor = MG_BLACK;
 else
     hashStore(footHash, pos);
 hvGfxBox(hvg, x, y, width, 2, footColor);
 }
 
 void drawLine(struct hvGfx *hvg, int x1, int y1, int x2, int y2, Color color, boolean isDashed)
 /* Draw vertical or horizontal */
 {
 if (isDashed)
     hvGfxDottedLine(hvg, x1, y1, x2, y2, color, TRUE);
 else
     hvGfxLine(hvg, x1, y1, x2, y2, color);
 }
 
 void drawFootMapbox(struct hvGfx *hvg, char *track,
                                 int start, int end, char *item, char *status,
                                 int x, int y, int width, Color peakColor, Color highlightColor)
 /* Draw grab box and add map box */
 {
-char *clickArg = endpointClickArg(item);
+// Add var to identify endpoint ('foot'), or NULL if no name for endpoint */
+char *clickArg = NULL;
+if (!isEmptyTextField(item))
+    {
+    char buf[256];
+    safef(buf, sizeof(buf),"foot=%s", cgiEncode(item));
+    clickArg = cloneString(buf);
+    }
 char *itemBuf = isEmptyTextField(item) ? status : item;
 hvGfxBox(hvg, x-1, y, 3, 2, peakColor);
 hvGfxBox(hvg, x, y, 1, 1, highlightColor);
 mapBoxHgcOrHgGene(hvg, start, end, x - width, y, width * 2, 4,
                    track, item, itemBuf, NULL, TRUE, clickArg);
 }
 
 void drawPeakMapbox(struct hvGfx *hvg, char *track,
                                 int seqStart, int seqEnd, char *item, char *status,
                                 int x, int y, Color peakColor, Color highlightColor)
 /* Draw grab box and add map box */
 {
 hvGfxBox(hvg, x-1, y-1, 3, 3, peakColor);
 hvGfxBox(hvg, x, y, 1, 1, highlightColor);
 mapBoxHgcOrHgGene(hvg, seqStart, seqEnd, x-1, y-1, 3, 3,