Skip to content

Commit cd19cfc

Browse files
fix(web): fix fullscreen mode scale calculations (#828)
1 parent 7829f4a commit cd19cfc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

web-client/iron-remote-desktop/src/iron-remote-desktop.svelte

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -523,15 +523,14 @@
523523
524524
function fullResize() {
525525
const windowSize = getWindowSize();
526-
const wrapperBoundingBox = wrapper.getBoundingClientRect();
527526
528-
const containerWidth = windowSize.x - wrapperBoundingBox.x;
529-
const containerHeight = windowSize.y - wrapperBoundingBox.y;
527+
const containerWidth = windowSize.x;
528+
const containerHeight = windowSize.y;
530529
531530
let width = canvas.width;
532531
let height = canvas.height;
533532
534-
const ratio = Math.max(containerWidth / canvas.width, containerHeight / canvas.height);
533+
const ratio = Math.min(containerWidth / canvas.width, containerHeight / canvas.height);
535534
width = width * ratio;
536535
height = height * ratio;
537536

0 commit comments

Comments
 (0)