70a65ed4387fc8ec456ef642b0bea8ff64f69636 galt Thu Apr 7 13:05:12 2016 -0700 trying to clarify and simplify the variables used in gtex totalHeight. diff --git src/hg/hgTracks/gtexTracks.c src/hg/hgTracks/gtexTracks.c index 558ddc5..caf2d99 100644 --- src/hg/hgTracks/gtexTracks.c +++ src/hg/hgTracks/gtexTracks.c @@ -1031,48 +1031,56 @@ struct gtexGeneBed *geneBed = geneInfo->geneBed; return geneBed->name; } static int gtexGeneHeight(void *item) { struct gtexGeneInfo *geneInfo = (struct gtexGeneInfo *)item; assert(geneInfo->height != 0); return geneInfo->height; } static int gtexGeneTotalHeight(struct track *tg, enum trackVisibility vis) /* Figure out total height of track. Set in track and also return it */ { int height = 0; +int lineHeight = 0; +int heightPer = 0; if (vis == tvDense) { - height = tgFixedTotalHeightOptionalOverflow(tg, vis, tl.fontHeight+1, tl.fontHeight, FALSE); + heightPer = tl.fontHeight; + lineHeight=heightPer+1; } else if (vis == tvSquish) { // for visibility, set larger than the usual squish, which is half font height - height = gtexSquishItemHeight() * 2; // the squish packer halves this - height = tgFixedTotalHeightOptionalOverflow(tg, vis, height+1, height, FALSE); + heightPer = gtexSquishItemHeight() * 2; // the squish packer halves this + lineHeight=heightPer+1; } else if ((vis == tvPack) || (vis == tvFull)) { // layout -- initially as fixed height - //int lineHeight = gtexGeneMaxHeight(tg); // TODO KATE THIS MAY BE OBSOLETE - int lineHeight = tl.fontHeight; - height = tgFixedTotalHeightOptionalOverflow(tg, vis, lineHeight, lineHeight, FALSE); + //heightPer = gtexGeneMaxHeight(tg); // TODO KATE THIS MAY BE OBSOLETE + heightPer = tl.fontHeight; + lineHeight=heightPer; + } + +height = tgFixedTotalHeightOptionalOverflow(tg, vis, lineHeight, heightPer, FALSE); +if ((vis == tvPack) || (vis == tvFull)) + { // set variable height rows if (tg->ss->rowCount != 0) { if (!tg->ss->rowSizes) { // collect the rowSizes data across all windows assert(currentWindow==windows); // first window assert(tg->ss->vis == vis); // viz matches, we have the right one struct spaceSaver *ssHold; AllocVar(ssHold); struct track *tgSave = tg; for(tg=tgSave; tg; tg=tg->nextWindow) { assert(tgSave->ss->vis == tg->ss->vis); // viz matches, we have the right one spaceSaverSetRowHeights(tg->ss, ssHold, gtexGeneHeight);