bb51679bd69bfa8e0146652bf2e27d07a3f85b52 max Wed Aug 21 06:02:14 2024 -0700 add a checkbox to the ruler track to show the amino acids, rather than relying for this single decoration option on the visibility, refs #33307 diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c index 6576258..73ea148 100644 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@ -4945,35 +4945,43 @@ if (withLeftLabels) { sliceWidth[stButton] = trackTabWidth + 1; sliceWidth[stSide] = leftLabelWidth - sliceWidth[stButton] + 1; sliceOffsetX[stSide] = (revCmplDisp ? (tl.picWidth - sliceWidth[stSide] - sliceWidth[stButton]) : sliceWidth[stButton]); sliceOffsetX[stButton] = (revCmplDisp ? (tl.picWidth - sliceWidth[stButton]) : 0); } sliceOffsetX[stData] = (revCmplDisp ? 0 : sliceWidth[stSide] + sliceWidth[stButton]); sliceWidth[stData] = tl.picWidth - (sliceWidth[stSide] + sliceWidth[stButton]); } struct flatTracks *flatTracks = NULL; struct flatTracks *flatTrack = NULL; +// There are two ways to get the amino acids to show up: +// 1) either by setting the ruler track viz to full +// 2) or by checking the box on the ruler track's trackUi page. +// Any selection on the trackUi page takes precedence. if (rulerMode != tvFull) { rulerCds = FALSE; } +// the code below will only use the checkbox on trackUi if a setting on the trackUi page has been made. +if (cartVarExists(cart, BASE_SHOWCODONS)) + rulerCds = cartUsualBoolean(cart, BASE_SHOWCODONS, TRUE); + /* Figure out height of each visible track. */ pixHeight = gfxBorder; // figure out height of ruler if (rulerMode != tvHide) { if (!baseShowRuler && !baseTitle && !baseShowPos && !baseShowAsm && !baseShowScaleBar && !zoomedToBaseLevel && !rulerCds) { warn("Can't turn everything off in base position track. Turning ruler back on"); baseShowRuler = TRUE; cartSetBoolean(cart, BASE_SHOWRULER, TRUE); } if (baseTitle) basePositionHeight += titleHeight;