Skip to content

Commit

Permalink
Offset page origin with viewer offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Yu committed Oct 4, 2024
1 parent a8a2bce commit 399b270
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions viewer/components/refresh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,17 @@ function addMasks() {
continue
}

const viewerBound = viewerDom.getBoundingClientRect()
const pageBound = visiblePage.view.div.getBoundingClientRect()
const canvasBound = canvas.getBoundingClientRect()

const div = document.createElement('div')
div.className = 'page-loading-mask'
masks.push(div)
div.style.display = 'none'
div.style.left = pageBound.x + 'px'
div.style.top = pageBound.y + 'px'
div.style.width = Math.min(viewerDom.getBoundingClientRect().width, pageBound.width) + 'px'
div.style.left = pageBound.x - viewerBound.x + 'px'
div.style.top = pageBound.y - viewerBound.y + 'px'
div.style.width = pageBound.width + 'px'
div.style.height = pageBound.height + 'px'

const img = new Image()
Expand Down

0 comments on commit 399b270

Please sign in to comment.