Skip to content

Commit

Permalink
Git Issue 1400 (#1404)
Browse files Browse the repository at this point in the history
  • Loading branch information
turner authored Oct 18, 2021
1 parent b9c0365 commit b7a6285
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions js/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,16 @@ class Browser {
return this.config.minimumBases;
}

// Zoom in by a factor of 2, keeping the same center location
zoomIn() {
this.zoomWithScaleFactor(0.5)
};

// Zoom out by a factor of 2, keeping the same center location if possible
zoomOut() {
this.zoomWithScaleFactor(2.0)
};

async zoomWithScaleFactor(scaleFactor, centerBPOrUndefined, referenceFrameOrUndefined) {

const viewportWidth = this.calculateViewportWidth(this.referenceFrameList.length)
Expand Down
6 changes: 4 additions & 2 deletions js/ui/zoomWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ const ZoomWidget = function (browser, parent) {
this.zoomContainer.appendChild(this.zoomOutButton)
this.zoomOutButton.appendChild(Icon.createIcon('minus-circle'))
this.zoomOutButton.addEventListener('click', () => {
browser.zoomWithScaleFactor(2.0)
// browser.zoomWithScaleFactor(2.0)
browser.zoomOut()
})

// Range slider
Expand Down Expand Up @@ -85,7 +86,8 @@ const ZoomWidget = function (browser, parent) {
this.zoomContainer.appendChild(this.zoomInButton)
this.zoomInButton.appendChild(Icon.createIcon('plus-circle'))
this.zoomInButton.addEventListener('click', () => {
browser.zoomWithScaleFactor(0.5)
// browser.zoomWithScaleFactor(0.5)
browser.zoomIn()
})

browser.on('locuschange', (referenceFrameList) => {
Expand Down

0 comments on commit b7a6285

Please sign in to comment.