Turns out you can draw canvases on other canvases. See the "Compositing" section of the CanvasRenderingContext2D documentation.
If we create a sub-canvas for drawable images, it only needs to be re-drawn when we change a pixel, and we would only have to draw over that pixel. Then we can just draw the sub-canvas at whatever zoom/pan we want on the main canvas (ImageCanvas). We can also have another sub-canvas for gridlines so that we never have to redraw it
Turns out you can draw canvases on other canvases. See the "Compositing" section of the CanvasRenderingContext2D documentation.
If we create a sub-canvas for drawable images, it only needs to be re-drawn when we change a pixel, and we would only have to draw over that pixel. Then we can just draw the sub-canvas at whatever zoom/pan we want on the main canvas (ImageCanvas). We can also have another sub-canvas for gridlines so that we never have to redraw it