Live data from Hacker News

Tldraw – a tiny little drawing app

tldraw.com

71–80 of 115 posts

Re: Tldraw – a tiny little drawing app

#72

Reminds me of https://excalidraw.com/

I'm a big fan of Excalidraw! And a contributor, too, I implemented the pen tool in Excalidraw. Both apps use my library perfect-freehand (https://github.com/steveruizok/perfect-freehand) for the digital ink.

The main difference between the two is that Excalidraw renders to HTML canvas, while tldraw renders to a regular DOM tree. There are tradeoffs but this lets us make things like sticky notes or other types of complex embedded content without too much difficulty.

Re: Tldraw – a tiny little drawing app

#73
post #57

I like the pressure changes when you draw. Different sized pen/brush would be helpful. As would being able to choose to delete the entire line with the easer or just to erase a little of it off at a time

Thanks! There are some size options in the menu at the top right.

And yeah, I've spent so much time thinking about how to do an eraser right! I think it will need to wait until the next version of my digital ink library. https://twitter.com/steveruizok/status/1458712896620404742

Re: Tldraw – a tiny little drawing app

#74
post #64

I’m curious what the relationship between Tldraw and Excalidraw is. They share some dependencies, and I think I remember @steveruizok adding this freehand ink feature to excalidraw. Is there a plan to rebase the excalidraw canvas on tldraw core? If I start prototyping a new UI today, should I start based on tldraw or excalidraw?

Yep, I'm a big fan of Excalidraw and am a contributor there too. I also re-implemented the pen tool in Excalidraw to use my digital ink library, perfect freehand (https://github.com/steveruizok/perfect-freehand), which is used extensively in tldraw.

tldraw is a separate project. The big difference is that Excalidraw renders to HTML canvas while tldraw renders to a regular DOM tree. There's a trade off: canvas can have better performance on some machines, while my approach with tldraw makes it easier to implement more complex embedded content. I wouldn't expect any changes, so use whichever you prefer!

Re: Tldraw – a tiny little drawing app

#75

Very nice. What API is used to track Shift/Ctrl/Alt keys state?

There is the standard event.getModifierState() API, but the most reliable solution I found was to listen for "keydown", "keyup", "blur", "pointerdown", "pointermove" and "pointerup" events on the window object and then store the modifier keys state based on the value of event.ctrlKey/altKey/metaKey/shiftKey. You need to listen for the pointer events because some devices such as Wacom tablets do not dispatch proper ke…

Yep, these all come from events.

Re: Tldraw – a tiny little drawing app

#79
I do some digital illustration, so maybe my perception is colored by a workflow that can't be generalized to others, but I am puzzled by it switching back to the arrow tool after drawing a shape. If I just drew a circle, I'm far more likely to draw another circle than select something.

Re: Tldraw – a tiny little drawing app

#80

Really nice app. So much finesse. Similar but seemingly simpler than the excellent https://excalidraw.com/ . Tiny thing: I think it would be clearer if the alt tags and menu items showed keyboard shortcuts as "[ctrl][G]" instead of "c t r l G".

Nice, didn’t Know about any of these two. Both are surprisingly responsive and fluid. Still not sure what I’d use this for; maybe explaining some math stuff.
Post reply on HN