d0dbf26fa75c67764c6cb8cb3aa370cdf62f1e17
braney
  Fri May 27 13:13:47 2022 -0700
fix drag scroll problem with chromAuthority is not the native system

diff --git src/hg/hgTracks/imageV2.c src/hg/hgTracks/imageV2.c
index 5403b66..7ac56a3 100644
--- src/hg/hgTracks/imageV2.c
+++ src/hg/hgTracks/imageV2.c
@@ -3,30 +3,31 @@
 /* Copyright (C) 2014 The Regents of the University of California 
  * See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */
 #include "common.h"
 #include "hPrint.h"
 #include "chromInfo.h"
 #include "hdb.h"
 #include "hui.h"
 #include "jsHelper.h"
 #include "cheapcgi.h"
 #include "htmshell.h"
 #include "imageV2.h"
 #include "hgTracks.h"
 #include "hgConfig.h"
 #include "regexHelper.h"
 #include "customComposite.h"
+#include "chromAlias.h"
 
 // Note: when right-click View image (or pdf output) then theImgBox==NULL, so it will be rendered as a single simple image
 struct imgBox   *theImgBox   = NULL; // Make this global for now to avoid huge rewrite
 struct imgTrack *curImgTrack = NULL; // Make this global for now to avoid huge rewrite
 
 /////////////////////////
 // FLAT TRACKS
 // A simplistic way of flattening the track list before building the image
 // NOTE: Strategy is NOT to use imgBox->imgTracks, since this should be independednt of imageV2
 /////////////////////////
 void flatTracksAdd(struct flatTracks **flatTracks,struct track *track,struct cart *cart, struct slName *orderedWiggles)
 // Adds one track into the flatTracks list
 {
 struct flatTracks *flatTrack;
 AllocVar(flatTrack);
@@ -1370,31 +1371,31 @@
 
 long positionWidth = (long)((imgBox->portalEnd - imgBox->portalStart) * imageMultiple);
 *chromStart = imgBox->portalStart - (long)(  ((imageMultiple - 1)/2)
                                           * (imgBox->portalEnd - imgBox->portalStart));
 if (*chromStart < 0)
     *chromStart = 0;
 *chromEnd = *chromStart + positionWidth;
 // get chrom size
 long virtChromSize = 0;
 if (sameString(imgBox->chrom, MULTI_REGION_VIRTUAL_CHROM_NAME))
     {
     virtChromSize = virtSeqBaseCount;
     }
 else
     {
-    struct chromInfo *chrInfo = hGetChromInfo(imgBox->db,imgBox->chrom);
+    struct chromInfo *chrInfo = hGetChromInfo(imgBox->db,chromAliasFindNative(imgBox->chrom));
     if (chrInfo == NULL)
 	{
 	*chromStart = imgBox->chromStart;
 	*chromEnd   = imgBox->chromEnd;
 	return FALSE;
 	}
     virtChromSize = chrInfo->size;
     }
 if (*chromEnd > virtChromSize)  // Bound by chrom length
     {
     *chromEnd = virtChromSize;
     *chromStart = *chromEnd - positionWidth;
     if (*chromStart < 0)
         *chromStart = 0;
     }