mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-19 02:48:12 +08:00
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:
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user