PaintWithBob / paint-with-bob

Bob Ross Painting IO game development.
https://paintwithbob.com/
Apache License 2.0
4 stars 0 forks source link

Canvas performance #75

Closed torch2424 closed 6 years ago

torch2424 commented 6 years ago

Profiler shows that the culprit is this in canvas.component.ts

// Wrap in a requestIdleCallback
                        this.canvasUpdateEvent = ric.requestIdleCallback(() => {
                            this.canvasUpdateEvent = false;
                            // Get the snapshot, and set it to our canvas
                            const snapshot = JSON.parse(data.snapshot);
                            this.canvas.loadSnapshot(snapshot);
                        });

Probably don't want to fork literally canvas, since it is written in c o f f e e s c r i p t

Though, we may want to just repeatedly push an svg to the dom using innerHtml http://literallycanvas.com/api/LiterallyCanvas.html#exporting-images

Links

https://github.com/literallycanvas/literallycanvas/issues/492

torch2424 commented 6 years ago

Fixed by https://github.com/PaintWithBob/paint-with-bob/commit/dc1dbf224784d089a4161f625f70bf2b22246f5e

Was accidentally pushed to master because of the #73 fiasco