8c133e4cce9a22502af7d42f478e766a491af33e
tdreszer
Wed Aug 3 16:13:26 2011 -0700
A more complete fix for 1X scrolling with packed sideLabels being in image. There should be 2 separate images: data and side, and I had to find all cases that write to the sideLabel. doLeftLabel() functions were easy and taken care of by passing the right image pointer. But some drawItem code also wrote to side labels and this needed a global hvgSide pointer to write to.
diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c
index c0c516a..cd55f28 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -73,30 +73,31 @@
* beginning of tracksDisplay(), and then used by loadCustomTracks(). */
char *ctFileName = NULL; /* Custom track file. */
struct customTrack *ctList = NULL; /* Custom tracks. */
boolean hasCustomTracks = FALSE; /* whether any custom tracks are for this db*/
struct slName *browserLines = NULL; /* Custom track "browser" lines. */
boolean withNextItemArrows = FALSE; /* Display next feature (gene) navigation buttons near center labels? */
boolean withPriorityOverride = FALSE; /* Display priority for each track to allow reordering */
int gfxBorder = hgDefaultGfxBorder; /* Width of graphics border. */
int guidelineSpacing = 12; /* Pixels between guidelines. */
boolean withIdeogram = TRUE; /* Display chromosome ideogram? */
int rulerMode = tvHide; /* on, off, full */
+struct hvGfx *hvgSide = NULL; // An extra pointer to a side label image that can be built if needed
char *rulerMenu[] =
/* dropdown for ruler visibility */
{
"hide",
"dense",
"full"
};
char *protDbName; /* Name of proteome database for this genome. */
#define MAX_CONTROL_COLUMNS 6
#define LOW 1
#define MEDIUM 2
#define BRIGHT 3
#define MAXCHAINS 50000000
@@ -1886,31 +1887,30 @@
int rulerTranslationHeight = codonHeight * 3; // 3 frames
int yAfterRuler = gfxBorder;
int yAfterBases = yAfterRuler; // differs if base-level translation shown
boolean rulerCds = zoomedToCdsColorLevel;
int rulerClickHeight = 0;
int newWinWidth = 0;
/* Figure out dimensions and allocate drawing space. */
pixWidth = tl.picWidth;
leftLabelX = gfxBorder;
leftLabelWidth = insideX - gfxBorder*3;
struct image *theOneImg = NULL; // No need to be global, only the map needs to be global
struct image *theSideImg = NULL; // Because dragScroll drags off end of image, the side label gets seen. Therefore we need 2 images!!
-struct hvGfx *hvgSide = NULL; // Strategy an extra pointer to a side image that can be built if needed
//struct imgTrack *curImgTrack = NULL; // Make this global for now to avoid huge rewrite
struct imgSlice *curSlice = NULL; // No need to be global, only the map needs to be global
struct mapSet *curMap = NULL; // Make this global for now to avoid huge rewrite
// Set up imgBox dimensions
int sliceWidth[stMaxSliceTypes]; // Just being explicit
int sliceOffsetX[stMaxSliceTypes];
int sliceHeight = 0;
int sliceOffsetY = 0;
char *rulerTtl = NULL;
if(theImgBox)
// theImgBox is a global for now to avoid huge rewrite of hgTracks. It is started
// prior to this in doTrackForm()
{
rulerTtl = (dragZooming?"drag select or click to zoom":"click to zoom 3x");
hPrintf("\n", database);
@@ -2064,44 +2064,42 @@
boolean transparentImage = FALSE;
if (theImgBox!=NULL)
transparentImage = TRUE; // transparent because BG (blue ruler lines) is separate image
trashDirFile(&gifTn, "hgt", "hgt", ".png");
hvg = hvGfxOpenPng(pixWidth, pixHeight, gifTn.forCgi, transparentImage);
if(theImgBox)
{
// Adds one single image for all tracks (COULD: build the track by track images)
theOneImg = imgBoxImageAdd(theImgBox,gifTn.forHtml,NULL,pixWidth, pixHeight,FALSE);
theSideImg = theOneImg; // Unlkess this is overwritten below, there is a single image
}
hvgSide = hvg; // Unlkess this is overwritten below, there is a single image
-#if defined(IMAGEv2_DRAG_SCROLL_SZ) && (IMAGEv2_DRAG_SCROLL_SZ > 1)
if (theImgBox && theImgBox->showPortal && withLeftLabels)
{
// TODO: It would be great to make the images smaller, but keeping both the same full size for now
struct tempName gifTnSide;
trashDirFile(&gifTnSide, "hgt", "side", ".png");
hvgSide = hvGfxOpenPng(pixWidth, pixHeight, gifTnSide.forCgi, transparentImage);
// Also add the side image
theSideImg = imgBoxImageAdd(theImgBox,gifTnSide.forHtml,NULL,pixWidth, pixHeight,FALSE);
hvgSide->rc = revCmplDisp;
initColors(hvgSide);
}
-#endif/// defined(IMAGEv2_DRAG_SCROLL_SZ) && (IMAGEv2_DRAG_SCROLL_SZ > 1)
}
hvg->rc = revCmplDisp;
initColors(hvg);
/* Start up client side map. */
hPrintf("