Skip to content

Commit

Permalink
fix SVG for feature labels
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinso committed Jun 4, 2021
1 parent c76907b commit df81773
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/feature/featureTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down

0 comments on commit df81773

Please sign in to comment.