holxsam / tldraw-in-obsidian

A plugin to integrate Tldraw into Obsidian.
Apache License 2.0
205 stars 10 forks source link

Add padding when embedding #65

Open Igorgro opened 1 week ago

Igorgro commented 1 week ago

When embedding tldraw drawing into a note the content is cut off too closer to drawing content. It worth adding a small (or configurable) padding around drawing content. For example on the following picture (this is a screenshot of tldraw drawing embedded into a note) the top part of the arrow is cut off: image

jon-dez commented 1 week ago

I can implement this as a configurable option in the settings tab. Though, I think having a padding that applies to all embed might not be the best approach depending on the scale of each drawing. There is a way to set the bounds manually for an individual embed, though it might be a little tedious (https://github.com/holxsam/tldraw-in-obsidian/issues/59: See "Set bounds on embed"). I can try to implement a better way to set the bounds automatically by using a rectangle select tool in the interactive mode. What do you think?

jon-dez commented 1 day ago

@Igorgro Check out this release: https://github.com/jon-dez/tldraw-in-obsidian/releases/tag/1.14.0

You can set custom padding via the settings panel, or control the bounds of the embed view by using the embed bounds selection tool.