Skip to content

Custom shape is not rendering to the intended shape #3207

Closed Answered by SomeHats
Infinity-code asked this question in Q&A
Discussion options

You must be logged in to vote

(answered on discord, copy-pasting my answer here in case it's helpful in future)

There's a couple different things going on here that involve the shape of a shape:

  1. getGeometry. This describes tldraw's internal view of the shape and is used for stuff like hit testing and arrow binding. You can see what it looks like by opening the debug menu in the bottom right, and checking "debug geometry" in the "debug flags" section
  2. component. This is a react component that returns the HTML (or SVG) that actually gets rendered at the shape. This is what's on screen in that screenshot!
  3. indicator. This is another react component that returns the SVG for the shape indicator which shows when it's hovered.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by SomeHats
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants