tldraw / tldraw

SDK for creating whiteboards and canvas experiences on the web.

Home Page:https://tldraw.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature]: Support other custom shapes to have clip path imposed on their children?

xmliszt opened this issue · comments

What's the feature?

I am creating my custom shape, which I would like it to behave similarly to the TLFrameShape, so that its children shapes will be clipped by its bound when the children are partially out of the bound like what is shown below.

CleanShot 2024-04-12 at 14 37 51@2x

By looking at the source code, I realize this is not possible because https://github.com/tldraw/tldraw/blob/main/packages/editor/src/lib/editor/Editor.ts#L3999-L4001 suggests that we are only getting the masks from ancestors which are strictly TLFrameShape.

carbon

I am not sure if there is a workaround such that I can let the editor use my custom shape type to determine the masks area? Or if not, perhaps it could be a feature enhancement?

Contact Details

xmliszt@gmail.com

Code of Conduct

  • I agree to follow this project's Code of Conduct