Create crayon brush in paperjs

20 views
Skip to first unread message

Sinan Isgenderli

unread,
Mar 17, 2024, 7:19:18 PMMar 17
to Paper.js
Hi all!
I'm trying to create a crayon brushing using paperjs, but it's not working. Analogous to factory brushing: github . I completely converted the code into paperjs code, but the code slowed down a lot when creating X number of new rect forms in the loop while dragging. Even if you create a form in advance, create it in advance in onMouseDown action. To summarize, I tried to implement it in two ways:
1. Create a new element and immediately transfer it to the symbol in onMouseDown.
2. When onMouseDrag, multiply and change the location of the symbol.
or
1. Create the required number of rect shapes with the required coordinates immediately in onMouseDrag.
Everything is implemented perfectly, but there is one BUT: the code is very slow. What should I do?
Reply all
Reply to author
Forward
0 new messages