Skip to content

Commit

Permalink
Fix autoscale bug affecting alignment coverage track in multilocus vi…
Browse files Browse the repository at this point in the history
…ew -- only rightmost view was considered.
  • Loading branch information
jrobinso committed Jan 26, 2023
1 parent 50512ce commit cc4dec1
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions js/trackView.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ class TrackView {
}

if (this.track.autoscale) {
let allFeatures
let allFeatures = []
for (let visibleViewport of visibleViewports) {
const referenceFrame = visibleViewport.referenceFrame
const start = referenceFrame.start
Expand All @@ -421,15 +421,11 @@ class TrackView {
// If the "features" object has a getMax function use it. Currently only alignmentContainer implements this, for coverage.
if (typeof visibleViewport.featureCache.features.getMax === 'function') {
const max = visibleViewport.featureCache.features.getMax(start, end)
allFeatures = [{value: max}]
allFeatures.push({value: max})
} else {
const viewFeatures = FeatureUtils.findOverlapping(visibleViewport.featureCache.features, start, end)
if(!allFeatures) {
allFeatures = viewFeatures
} else {
for(let f of viewFeatures) {
allFeatures.push(f)
}
for (let f of viewFeatures) {
allFeatures.push(f)
}
}
}
Expand Down

0 comments on commit cc4dec1

Please sign in to comment.