ecj2 / momo

[NOT MAINTAINED / ABANDONED] A simple 2D game-making library written in JavaScript.
MIT License
1 stars 0 forks source link

Issues with resizing the main canvas #18

Closed ecj2 closed 6 years ago

ecj2 commented 6 years ago

Momo.resizeCanvas() does not play nicely with Momo.clearCanvas(). The latter clears the target, which is the main canvas, but the target copies the main canvas by value, not by reference, so changing the main canvas' size is not reflected on the target. In other words, when the main canvas is resized, only the old area belonging to the target is cleared. To remedy this, a check should be done when resizing the main canvas to see if the main canvas is the current target, and if it is, update the target's dimensions accordingly.