Closed felixpalmer closed 1 year ago
deckRenderer.renderLayers
should abort the flow if viewports
is empty.
8.9.26
I found a similar problem that is related to the same origin under very specific conditions.
You can replicate it under every use of the mask effect, e.g. the official example at https://codepen.io/vis-gl/pen/ExbKoYg
If you have two screens on your desktop of which one is bigger than the other, e.g.
When using Firefox and you position your mouse fully at the top-outside of the left screen (number 2) without reaching the right screen as you have to move your mouse down the arrive at the screen number 1, the prerender fails exactly as in this issue as no viewport is defined.
The issue can be circumvent by adding a check for the viewport before checking the resolution
if (viewport===undefined) {
return {didRender};
}
This might be triggered by an unanticipated behavior of the browser. However, I think it would make sense to control for such behaviors directly by verification that a viewport exists before crashing in such scenarios.
Framework version: deck.gl@8.9.35 Browser: Firefox OS: Windows 10
Could you make a PR?
Okay, I will do so!
Description
When the canvas is 0px, deck.gl crashes with the following error:
Flavors
Expected Behavior
No response
Steps to Reproduce
Modify https://deck.gl/docs/api-reference/extensions/mask-extension:
The cause of this bug is that a 0 height canvas leads
this.viewManager!.getViewports()
to return[]
, which triggers the error inMaskEffect
:https://github.com/visgl/deck.gl/blob/master/modules/extensions/src/mask/mask-effect.ts#L83
Environment
Logs
No response