Desktop: Make shutdown more robust and fix panic caused by invalid viewport scale (#3783)

* Fix panic caused by invalid viewport scale

* Make shutdown more robust
This commit is contained in:
Timon
2026-02-22 17:28:35 +00:00
committed by GitHub
parent 9d83998463
commit a2d3b3f410
5 changed files with 26 additions and 3 deletions

View File

@@ -42,6 +42,10 @@ export function setupViewportResizeObserver(editor: Editor) {
// 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;
}
editor.handle.updateViewport(bounds.x, bounds.y, logicalWidth, logicalHeight, scale);
}
});