BruceSherwood/glowscript

Resizing a canvas doesn't work

Closed this issue · 1 comments

box()
scene.width = scene.height = 100

will result in the cube being drawn in the bottom left corner of the canvas at a tiny size, and new objects will also appear there instead of at the actual center.

I figured out what was wrong here also. In the current code, there was some circularity to the update of height and width. Also, the CSS height and width were being updated but the canvas height and width properties were not being update in synchrony.

I added it to the new branch I created (canvas-resize), so 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. Resizing after creating objects does not mess up the canvas.