024350b3ce6fdf80e44f62e7fcbfdfc3535ebb93
max
  Tue May 7 14:05:00 2013 -0700
fixing a bug where a bed3 file crashed the mouseOver mapItem method. Moved this method now into the linkedFeatures code, where it should have been from the start
diff --git src/hg/hgTracks/simpleTracks.c src/hg/hgTracks/simpleTracks.c
index ec090dc..98ae477 100644
--- src/hg/hgTracks/simpleTracks.c
+++ src/hg/hgTracks/simpleTracks.c
@@ -3490,38 +3490,55 @@
 
 int linkedFeaturesItemStart(struct track *tg, void *item)
 /* Return start chromosome coordinate of item. */
 {
 struct linkedFeatures *lf = item;
 return lf->start;
 }
 
 int linkedFeaturesItemEnd(struct track *tg, void *item)
 /* Return end chromosome coordinate of item. */
 {
 struct linkedFeatures *lf = item;
 return lf->end;
 }
 
+static void linkedFeaturesMapItem(struct track *tg, struct hvGfx *hvg, void *item,
+				char *itemName, char *mapItemName, int start, int end,
+				int x, int y, int width, int height)
+/* Draw the mouseOver (aka statusLine) text from the mouseOver field of lf
+ * Fallback to itemName if there is no mouseOver field.
+ * (derived from bedPlusLabelMapItem) */
+{
+// Don't bother if we are imageV2 and a dense child.
+if (theImgBox && tg->limitedVis == tvDense && tdbIsCompositeChild(tg->tdb))
+    return;
+
+struct linkedFeatures *lf = item;
+char *mouseOverText   = (isEmpty(lf->mouseOver)) ? itemName: lf->mouseOver;
+mapBoxHc(hvg, start, end, x, y, width, height, tg->track, mapItemName, mouseOverText);
+}
+
 void linkedFeaturesMethods(struct track *tg)
 /* Fill in track methods for linked features. */
 {
 tg->freeItems = linkedFeaturesFreeItems;
 tg->drawItems = linkedFeaturesDraw;
 tg->drawItemAt = linkedFeaturesDrawAt;
 tg->itemName = linkedFeaturesName;
 tg->mapItemName = linkedFeaturesName;
+tg->mapItem = linkedFeaturesMapItem;
 tg->totalHeight = tgFixedTotalHeightNoOverflow;
 tg->itemHeight = tgFixedItemHeight;
 tg->itemStart = linkedFeaturesItemStart;
 tg->itemEnd = linkedFeaturesItemEnd;
 tg->itemNameColor = linkedFeaturesNameColor;
 tg->nextPrevExon = linkedFeaturesNextPrevItem;
 tg->nextPrevItem = linkedFeaturesLabelNextPrevItem;
 }
 
 int linkedFeaturesSeriesItemStart(struct track *tg, void *item)
 /* Return start chromosome coordinate of item. */
 {
 struct linkedFeaturesSeries *lfs = item;
 return lfs->start;
 }