Merge pull request #6505 from penpot/supearlex-fix-avoid-unncesary-clone-for-new-render

🐛 Avoid unnecesary clone call
This commit is contained in:
Aitor Moreno 2025-05-20 10:07:23 +02:00 committed by GitHub
commit 1bc97f9ad0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 3 deletions

View file

@ -33,7 +33,9 @@
const canvas = document.getElementById("canvas");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
const shapes = 1000;
const params = new URLSearchParams(document.location.search);
const shapes = params.get("shapes") || 1000;
initWasmModule().then(Module => {
init(Module);

View file

@ -32,7 +32,9 @@
const canvas = document.getElementById("canvas");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
const shapes = 1000;
const params = new URLSearchParams(document.location.search);
const shapes = params.get("shapes") || 1000;
initWasmModule().then(Module => {
init(Module);

View file

@ -484,7 +484,7 @@ impl RenderState {
));
canvas.clear(self.background_color);
canvas.draw_image(snapshot.clone(), (0, 0), Some(&skia::Paint::default()));
canvas.draw_image(snapshot, (0, 0), Some(&skia::Paint::default()));
canvas.restore();
}
}