BruceSherwood/glowscript

Changing canvas width or height after canvas activation

Closed this issue · 1 comments

If a canvas width or height is changed after activation (due to an object needing to be displayed) mouse picking does not work properly. What needs to be done is that when canvas width or height changes the size of the mouse picking texture memory needs to be changed accordingly.

I figured out what was wrong here. In the current code, the textures are being re-initialized each time the width or height changes. The buffers (frame and render/depth) also depend on width and height, but are not being re-initialized.

I created a new branch (canvas-resize) that we can merge once you are satisfied that this fixes the issue.

I have tested this in several ways tonight, as I need the resizing capability for another project I am working on. The pick function scales with the window.