CDAT / vcs-js

3 stars 3 forks source link

Unable to resize canvas #20

Closed James-Crean closed 6 years ago

James-Crean commented 6 years ago

In order to resize a plot canvas, we need to change the canvas height/width, then redraw the contents. It seems, however, that vcs-js sets the width/height itself during the redraw, resulting in unintended canvas sizes.

The image decoder has an event listener on "load" that contains the following lines:

_this.canvas.setAttribute('width', _this.imageDecoder.width);
_this.canvas.setAttribute('height', _this.imageDecoder.height);

Is there a workaround for this?

danlipsa commented 6 years ago

@James-Crean I have code in vcs-js that tests resizing. However, that works only with on-screen rendering. I'll have to debug it and see what is going on for off-screen rendering.

James-Crean commented 6 years ago

Charles informed me that since I do not have mesa in my conda environment that I am likely not doing off screen rendering. Let me know if you need more information to help troubleshoot this issue.