546e4b62f9c8abdda3576ce5b9bf8c4b82dc6b4e
braney
  Tue Mar 21 14:42:01 2023 -0700
make squishyPack work nicely with Javascript track reorder

diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c
index bde1681..2d275fd 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -4733,59 +4733,59 @@
 {
 struct track *nextTrack = NULL, *track;
 for (track = trackList; track != NULL; track = nextTrack)
     {
     nextTrack = track->next;
 
     if (track->visibility != tvPack)
         continue;
 
     char *string = cartOrTdbString(cart, track->tdb,  "squishyPackPoint", NULL);
     if (string != NULL)
         {
         double squishyPackPoint = atof(string);
 
         /* clone the track */
-        char buffer[strlen(track->track) + strlen("Squish") + 1];
-        safef(buffer, sizeof buffer, "%sSquish", track->track);
+        char buffer[strlen(track->track) + strlen("Squinked") + 1];
+        safef(buffer, sizeof buffer, "%sSquinked", track->track);
 
         struct track *squishTrack = CloneVar(track);
         squishTrack->tdb = CloneVar(track->tdb);
         squishTrack->tdb->track = cloneString(buffer);
         squishTrack->tdb->next = NULL;
         squishTrack->visibility = tvSquish;
         squishTrack->limitedVis = tvSquish;
         hashAdd(trackHash, squishTrack->tdb->track, squishTrack);
         struct linkedFeatures *lf = track->items;
 
         /* distribute the items based on squishyPackPoint */
         track->items = NULL;
         squishTrack->items = NULL;
         struct linkedFeatures *nextLf;
         for(; lf; lf = nextLf)
             {
             nextLf = lf->next;
             if (lf->squishyPackVal >= squishyPackPoint)
                 slAddHead(&squishTrack->items, lf);
             else
                 slAddHead(&track->items, lf);
             }
         slReverse(&track->items);
         slReverse(&squishTrack->items);
         
         squishTrack->track = cloneString(buffer);
-        squishTrack->originalTrack = track->track;
+        squishTrack->originalTrack = cloneString(track->track);
         squishTrack->shortLabel = cloneString(buffer);
         squishTrack->longLabel = cloneString(buffer);
 
         /* insert the squished track */
         track->next = squishTrack;
         squishTrack->next = nextTrack;
         }
     }
 }
 
 void makeActiveImage(struct track *trackList, char *psOutput)
 /* Make image and image map. */
 {
 struct track *track;
 MgFont *font = tl.font;
@@ -5197,30 +5197,32 @@
         {
         track = flatTrack->track;
 	if (!isLimitedVisHiddenForAllWindows(track))
             {
 	    struct track *winTrack;
 	    for (winTrack=track; winTrack; winTrack=winTrack->nextWindow)
 		{
 		if (winTrack->labelColor == winTrack->ixColor && winTrack->ixColor == 0)
 		    {
 		    winTrack->ixColor = hvGfxFindRgb(hvg, &winTrack->color);
 		    }
 		}
             int order = flatTrack->order;
             curImgTrack = imgBoxTrackFindOrAdd(theImgBox,track->tdb,NULL,track->limitedVis,
                                                isCenterLabelIncluded(track),order);
+            if (flatTrack->track->originalTrack != NULL)
+                curImgTrack->linked = TRUE;
             }
         }
     }
 
 
 /* Draw mini-buttons. */
 
 if (withLeftLabels && psOutput == NULL)
     {
     int butOff;
     boolean grayButtonGroup = FALSE;
     struct group *lastGroup = NULL;
     y = gfxBorder;
     if (rulerMode != tvHide)
         {