From f7e8056abeb55d1359f07a47c17a8e78faba3451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arno=C5=A1t=20Pleskot?= Date: Tue, 4 Jul 2023 17:10:20 +0200 Subject: [PATCH] feat: update constraints on window resize --- src/components/App.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/App.tsx b/src/components/App.tsx index 55d1edb03..15ee6c61a 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -7642,11 +7642,15 @@ class App extends React.Component { const { scrollX, scrollY, scrollConstraints, width, height, zoom } = this.state; + // Skip if scroll constraints are not defined or if the zoom level or viewport dimensions have not changed. + // Constrains and scene will update on change of viewport dimensions. if ( !scrollConstraints || (this.state.zoom.value === prevState.zoom.value && this.state.scrollX === prevState.scrollX && - this.state.scrollY === prevState.scrollY) + this.state.scrollY === prevState.scrollY && + this.state.width === prevState.width && + this.state.height === prevState.height) ) { return null; }