diff --git a/manifest.json b/manifest.json index 563cb40..c4874f4 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "tldraw", "name": "Tldraw", - "version": "1.5.1", + "version": "1.5.2", "minAppVersion": "0.15.0", "description": "Integrates Tldraw into Obsidian, allowing users to draw and edit content on a virtual whiteboard.", "author": "Sam Alhaqab", diff --git a/src/obsidian/helpers/TldrawAppEmbedViewController.ts b/src/obsidian/helpers/TldrawAppEmbedViewController.ts index 7ce929a..048931c 100644 --- a/src/obsidian/helpers/TldrawAppEmbedViewController.ts +++ b/src/obsidian/helpers/TldrawAppEmbedViewController.ts @@ -6,7 +6,7 @@ export type OnChangeViewMode = (mode: ViewMode) => void; export type OnChangeHandlers = { onViewMode: OnChangeViewMode; - onImageBounds: (bounds: BoxLike) => void; + onImageBounds: (bounds?: BoxLike) => void; onImageSize: (size?: { width: number, height: number }) => void; onViewOptions: (options: ImageViewModeOptions) => void; }; @@ -31,7 +31,7 @@ export type TldrawAppViewModeController = { getViewMode: () => ViewMode; getViewOptions: () => ImageViewModeOptions; setViewMode: (viewMode: ViewMode) => void; - setImageBounds: (bounds: BoxLike) => void; + setImageBounds: (bounds?: BoxLike) => void; setImageSize: (size?: {width: number, height: number}) => void; /** * @returns A function that unsets on-change handlers. diff --git a/src/obsidian/plugin/markdown-post-processor.ts b/src/obsidian/plugin/markdown-post-processor.ts index af1ef4c..b43e963 100644 --- a/src/obsidian/plugin/markdown-post-processor.ts +++ b/src/obsidian/plugin/markdown-post-processor.ts @@ -155,12 +155,8 @@ export async function markdownPostProcessor(plugin: TldrawPlugin, element: HTMLE const { bounds, imageSize } = parseEmbedValues(target) - controller.setImageSize(imageSize) - - if (bounds === undefined) return; - timer = setTimeout(async () => { - console.log(m[0]) + controller.setImageSize(imageSize) controller.setImageBounds(bounds); }, 500); }