Skip to content

Commit

Permalink
minor edit
Browse files Browse the repository at this point in the history
  • Loading branch information
turner committed Aug 8, 2023
1 parent 69761be commit d67a3a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dev/misc/png.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
console.log(`${ browser.guid } is good to go`)

document.querySelector('#igv-save-as-png-button').addEventListener('click', () => {
browser.savePNGtoFile('saveIGVJSToPNG.png')
browser.savePNGtoFile(`igvjs-screendump-${ browser.guid }.png`)
})

})
Expand Down
4 changes: 1 addition & 3 deletions js/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,13 +419,11 @@ class Browser {
}

savePNGtoFile(filename) {

html2canvas(document.querySelector('.igv-column-container'), { allowTaint: true }).then(canvas => {
html2canvas(this.columnContainer, { allowTaint: true }).then(canvas => {
const path = filename || 'igvjs.png'
const data = canvas.toDataURL('image/png')
FileUtils.download(path, data)
})

}

/**
Expand Down

0 comments on commit d67a3a2

Please sign in to comment.