naclcaleb / Draw

An online drawing program
https://naclcaleb.github.io/Draw/
GNU General Public License v3.0
4 stars 1 forks source link

Add Multiple Layer Support #12

Closed naclcaleb closed 5 years ago

naclcaleb commented 5 years ago

This is a slightly more robust issue to deal with, but I've got all the infrastructure built in. Basically it needs to have a UI somewhere out of the way but also easily available, and then in the code, a layer can be added by calling canvas.push(new Layer(CANVAS_WIDTH, CANVAS_HEIGHT)) somewhere in index.js. Then the active layer can be switched by changing the global variable ACTIVE_LAYER to the appropriate index in the canvas.layers array.

naclcaleb commented 5 years ago

This is simply to add the functionality for multiple layers.

I will say there is the possibility that the mouse events may not bubble correctly and they might need adjusting to get them working correctly.