diff --git a/dev/issues/git-1886.html b/dev/issues/git-1886.html new file mode 100644 index 000000000..a72b1556c --- /dev/null +++ b/dev/issues/git-1886.html @@ -0,0 +1,74 @@ + + + + + + Git Issue - 1886 + + + +
+

Git Issue - 1886

+
+ +
+
+
+ + + + diff --git a/js/bam/alignmentTrack.js b/js/bam/alignmentTrack.js index 90ef28273..752d8eb5a 100644 --- a/js/bam/alignmentTrack.js +++ b/js/bam/alignmentTrack.js @@ -304,6 +304,7 @@ class AlignmentTrack extends TrackBase { if (this.groupBy && groupName) { ctx.save() + ctx.font = '400 12px sans-serif' const textMetrics = ctx.measureText(groupName) const w = textMetrics.width + 10 @@ -314,14 +315,10 @@ class AlignmentTrack extends TrackBase { ctx.textAlign = "center" ctx.fillStyle = 'white' ctx.strokeStyle = 'lightGray' - ctx.beginPath() - ctx.roundRect(x, baselineY - textMetrics.actualBoundingBoxAscent - 5, w, h, 2) - ctx.fill() - ctx.stroke() + IGVGraphics.roundRect(ctx, x, baselineY - textMetrics.actualBoundingBoxAscent - 5, w, h, 2, 1, 1) ctx.fillStyle = 'black' ctx.fillText(groupName, x + w / 2, baselineY) - IGVGraphics.dashedLine(ctx, 0, alignmentY, pixelWidth, alignmentY) ctx.restore() @@ -1229,7 +1226,7 @@ class AlignmentTrack extends TrackBase { const y = clickState.y const offsetY = y - this.top const genomicLocation = clickState.genomicLocation - + if(features.packedGroups) { let minGroupY = Number.MAX_VALUE for (let group of features.packedGroups.values()) { diff --git a/js/trackViewport.js b/js/trackViewport.js index 80b675a4e..9a0acd9c7 100644 --- a/js/trackViewport.js +++ b/js/trackViewport.js @@ -475,7 +475,8 @@ class TrackViewport extends Viewport { context.saveWithTranslationAndClipRect(id, x, y, width, height, yClipOffset) - let {start, bpPerPixel} = this.referenceFrame + const {start, bpPerPixel} = this.referenceFrame + const pixelXOffset = Math.round((start - this.referenceFrame.start) / bpPerPixel) const config = { @@ -486,6 +487,8 @@ class TrackViewport extends Viewport { pixelTop: yClipOffset, pixelWidth: width, pixelHeight: height, + pixelXOffset, + pixelShift: pixelXOffset, bpStart: start, bpEnd: start + (width * bpPerPixel), bpPerPixel,