mirror of
https://github.com/penpot/penpot.git
synced 2025-08-02 13:58:28 +02:00
🎉 Improve zoom in/out performance
This commit is contained in:
parent
e0e381bdfc
commit
480e0887e3
4 changed files with 144 additions and 14 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue