From df81773947f375150cc34a75c5a23696810ac032 Mon Sep 17 00:00:00 2001 From: jrobinso Date: Thu, 3 Jun 2021 19:34:39 -0700 Subject: [PATCH] fix SVG for feature labels --- js/feature/featureTrack.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/feature/featureTrack.js b/js/feature/featureTrack.js index 60f950686..b25923c45 100755 --- a/js/feature/featureTrack.js +++ b/js/feature/featureTrack.js @@ -626,8 +626,9 @@ function renderFeatureLabel(ctx, feature, featureX, featureX1, featureY, referen if (!name || name === '.') return; - const t1 = Math.max(featureX, -options.pixelXOffset); - const t2 = Math.min(featureX1, -options.pixelXOffset + options.viewportWidth); + let pixelXOffset = options.pixelXOffset || 0; + const t1 = Math.max(featureX, - pixelXOffset); + const t2 = Math.min(featureX1, -pixelXOffset + options.viewportWidth); const centerX = (t1 + t2) / 2; let transform; @@ -644,7 +645,7 @@ function renderFeatureLabel(ctx, feature, featureX, featureX1, featureY, referen gtexSelection = true; geneColor = referenceFrame.selection.colorForGene(name); } - + const geneFontStyle = { textAlign: "SLANT" === this.labelDisplayMode ? undefined : 'center', fillStyle: geneColor || color,