diff --git a/frontend/src/utility-functions/viewports.ts b/frontend/src/utility-functions/viewports.ts index 670f2b1bea..989ea7dc40 100644 --- a/frontend/src/utility-functions/viewports.ts +++ b/frontend/src/utility-functions/viewports.ts @@ -41,11 +41,7 @@ export function setupViewportResizeObserver(editor: Editor) { const bounds = entry.target.getBoundingClientRect(); // TODO: Consider passing physical sizes as well to eliminate pixel inaccuracies since width and height could be rounded differently - const scale = physicalWidth / logicalWidth; - - if (!scale || scale <= 0) { - continue; - } + const scale = logicalWidth > 0 && physicalWidth > 0 ? physicalWidth / logicalWidth : 1; editor.handle.updateViewport(bounds.x, bounds.y, logicalWidth, logicalHeight, scale); }