644f1ed70c1b04896944f66bdfa03c16278135d6
braney
Fri Jul 31 15:16:12 2026 -0700
quickLift: keep the difference lines from standing still during a drag
The difference lines are drawn up over a track's center label, but center
labels don't scroll with the data, so the lines sat still while the image
moved underneath them. hgTracks now keeps each center label as text with
the color it was drawn in, and flags the label when lines were painted over
it. While the image is being dragged hgTracks.js hides that slice and puts
the label up as text in its place, then swaps the image back on drop.
Windows with no difference lines drawn are untouched. refs #37974
diff --git src/hg/hgTracks/imageV2.c src/hg/hgTracks/imageV2.c
index 82ad780d229..9564d622927 100644
--- src/hg/hgTracks/imageV2.c
+++ src/hg/hgTracks/imageV2.c
@@ -1905,32 +1905,37 @@
char *name,int offsetX,int offsetY,boolean useMap)
// writes an image as HTML
{
if (slice->parentImg && slice->parentImg->file != NULL)
{
hPrintf(" parentImg->file,offsetX,offsetY);
// Problem: dragScroll beyond left shows unsightly leftLabel!
// Tried clip:rect() but this only works with position:absolute!
// May need to split image betweeen side label and data!!! That is a big change.
if (useMap)
hPrintf(" usemap='#map_%s'",name);
hPrintf(" class='sliceImg %s",sliceTypeToClass(slice->type));
if (slice->type==stData && imgBox->showPortal) // || slice->type==stCenter will make centerLabels scroll too
- hPrintf(" panImg'");
- else
+ hPrintf(" panImg");
+ // When something is drawn over the center label (quickLift difference lines) that
+ // slice can't be shown while the image is being dragged: center labels don't scroll,
+ // so the lines would sit still while the image moves underneath them. Mark it so
+ // dragScroll can swap it for the text stand-in below.
+ if (slice->type==stCenter && imgTrack->cntrLabDrawnOver && imgTrack->cntrLabText != NULL)
+ hPrintf(" cntrLabLines");
hPrintf("'");
if (slice->title != NULL)
hPrintf(" title='%s'", attributeEncode(slice->title) ); // Adds slice wide title
else if (slice->parentImg->title != NULL)
hPrintf("' title='%s'", attributeEncode(slice->parentImg->title) );// Adds image wide title
if (slice->type==stData || slice->type==stCenter)
{
char id[256];
safef(id, sizeof id, "img_%s", name);
jsOnEventById("drag", id, "return false;");
}
hPrintf(">");
}
else
{
@@ -2023,30 +2028,45 @@
// Adjustment for portal
if (imgBox->showPortal && imgBox->basesPerPixel > 0
&& (sliceType==stData || sliceType==stCenter))
{
offsetX += (imgBox->portalStart - imgBox->chromStart) / imgBox->basesPerPixel;
width=imgBox->portalWidth;
}
hPrintf("