Skip to content

Commit

Permalink
Add an anchor node to cover the bottom margin of last page in pdf viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Yu committed Oct 4, 2024
1 parent 5c18051 commit 670aeaf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 12 additions & 0 deletions viewer/components/refresh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,18 @@ function addMasks() {
div.appendChild(img)
viewerContainer.appendChild(div)
div.style.display = 'inherit'

// This workaround is for the last page of the document.
const anchor = document.createElement('div')
anchor.className = 'page-loading-anchor'
masks.push(anchor)
anchor.style.display = 'inherit'
anchor.style.position = 'absolute'
anchor.style.left = pageBound.x - viewerBound.x + 'px'
anchor.style.top = pageBound.y - viewerBound.y + pageBound.height + 'px'
anchor.style.width = '10px'
anchor.style.height = '10px'
viewerContainer.appendChild(anchor)
}
return masks
}
Expand Down
2 changes: 0 additions & 2 deletions viewer/latexworkshop.css
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,6 @@ html[dir='rtl'] .findbar {
}

.page-loading-mask {
padding: 0;
margin: 0;
border: none;
box-shadow: 0px 0px 0px 1px lightgrey;
outline: none;
Expand Down

0 comments on commit 670aeaf

Please sign in to comment.