Skip to content

Commit

Permalink
fix, patch: Prevent possible Nan values if viewport has zero width an…
Browse files Browse the repository at this point in the history
…d/or height (#1652)

- happens rarely but has been observed. Unknown reason.
  • Loading branch information
nilscb authored Sep 11, 2023
1 parent 61596f9 commit 77ea355
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@ function getViewState(
let fb_target = [fb.x, fb.y, z];
let fb_zoom = fb.zoom;

if (deck) {
if (deck && deck.width > 0 && deck.height > 0) {
// If there are margins/rulers in the viewport (axes2DLayer) we have to account for that.
// Camera target should be in the middle of viewport minus the rulers.
const w_bounds = w;
Expand Down

0 comments on commit 77ea355

Please sign in to comment.