set fullscreen padding to the proper width

This commit is contained in:
Daniel Micay 2019-08-20 12:47:01 -04:00
parent be2439be65
commit 1da56e759f
2 changed files with 3 additions and 1 deletions

View File

@ -4,6 +4,7 @@ body, canvas, #padding {
}
#padding {
min-width: 100%;
background: black;
}

View File

@ -1,5 +1,6 @@
"use strict";
const padding = document.getElementById("padding");
let pdfDoc = null;
let pageRendering = false;
let renderPending = false;
@ -54,6 +55,7 @@ function display(newCanvas) {
canvas.width = newCanvas.width;
canvas.style.height = newCanvas.style.height;
canvas.style.width = newCanvas.style.width;
padding.style.width = canvas.style.width;
canvas.getContext("2d", { alpha: false }).drawImage(newCanvas, 0, 0);
scrollTo(0, 0);
}
@ -190,7 +192,6 @@ function isTextSelected() {
}
function updateInset() {
const padding = document.getElementById("padding");
const windowInsetTop = channel.getWindowInsetTop() / window.devicePixelRatio + "px";
padding.style.paddingTop = windowInsetTop;
textLayerDiv.style.top = windowInsetTop;