Skip to content

Commit c30887b

Browse files
committed
Merge branch 'master' into ccapture
2 parents 233f9f4 + 2b7075a commit c30887b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

resources/webview_base.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,14 @@
431431
}
432432
function computeSize() {
433433

434+
let forcedResolutions = [<!-- Forced Resolution -->];
435+
let zoom = forcedResolutions[0] > 0 ? 1.0/window.devicePixelRatio : 1.0;
436+
canvas.style.zoom = zoom;
437+
434438
// Compute forced aspect ratio and align canvas
435439
resolution = forceAspectRatio(window.innerWidth, window.innerHeight);
436-
canvas.style.left = `${(window.innerWidth - resolution.x) / 2}px`;
437-
canvas.style.top = `${(window.innerHeight - resolution.y) / 2}px`;
440+
canvas.style.left = `${(window.innerWidth - resolution.x*zoom) / 2}px`;
441+
canvas.style.top = `${(window.innerHeight - resolution.y*zoom) / 2}px`;
438442

439443
for (let buffer of buffers) {
440444
if (buffer.Target) {

0 commit comments

Comments
 (0)