erkyrath / quixe

A Glulx VM interpreter written in Javascript
http://eblong.com/zarf/glulx/
MIT License
169 stars 33 forks source link

Layout goes bad if the entire div is hidden #46

Open erkyrath opened 3 years ago

erkyrath commented 3 years ago

The Borogove web-I7 service sometimes hides the story div. This results in a crash -- possibly because the status window gets measured at zero height.

Quixe init: TypeError: Cannot set property 'dirty' of undefined Cannot set property 'dirty' of undefined TypeError

The interpreter should at least not crash in this situation. (Maybe it should freeze all layout while the div is offscreen or zero-size?)

erkyrath commented 3 years ago

Juhana commented (on Slack):

I managed to replicate, if you switch to another tab inside the editor while Quixe is loading it throws the error. Presumably it can't measure the window height correctly when it's hidden.

erkyrath commented 3 years ago

I was not able to reproduce this, but I found a logic hole which could allow this error (overrunning the win.lines array) if win.gridheight was zero. Fixed.