yosoyubik / canvas

Peer-to-peer paint app for Urbit
MIT License
142 stars 9 forks source link

[feature] continuous lines when drawing #36

Open ghost opened 2 years ago

ghost commented 2 years ago

currently if you drag the mouse across the screen fairly fast, you get dots of pixels instead of a line of pixels. you can just track the position of the last pixel and fill in the line between the two points, and then reset the position of the last pixel to null as soon as a mouseup event occurs to prevent drawing a line between two mousedown events instead of two mousemove (while event.buttons indicates click is held down) events or a mousedown event then mousemove event (again, button held down).

i have an example function here, but idk svelte so i can't submit a pull request.

yosoyubik commented 2 years ago

Ah, very cool, thanks @nogira for sharing this. I'll look into adding it after the next OTA drops. Also, very interesting to see your work on the pixel editor using HTML's canvas element—this is something I've been looking into to replace the current svg-generated pixels. Feel free to reach out on urbit at ~norsyr-torryn if you want to talk more about it.