🎉 Improve zoom in/out performance

This commit is contained in:
Alejandro Alonso 2025-04-25 12:22:01 +02:00
parent e0e381bdfc
commit 480e0887e3
4 changed files with 144 additions and 14 deletions

View file

@ -32,7 +32,7 @@
const canvas = document.getElementById("canvas");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
const shapes = 1_000;
const shapes = 100;
initWasmModule().then(Module => {
init(Module);
@ -50,8 +50,8 @@
useShape(uuid);
Module._set_parent(0, 0, 0, 0);
Module._set_shape_type(3);
const x1 = getRandomInt(0, canvas.width*3);
const y1 = getRandomInt(0, canvas.height*3);
const x1 = getRandomInt(0, canvas.width);
const y1 = getRandomInt(0, canvas.height);
const width = getRandomInt(20, 100);
const height = getRandomInt(20, 100);
Module._set_shape_selrect(x1, y1, x1 + width, y1 + height);