Skip to content

Commit

Permalink
Merge from jon-dez/main
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-dez committed Sep 6, 2024
2 parents 424f637 + e8cc466 commit 155732c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/obsidian/helpers/TldrawAppEmbedViewController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand All @@ -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.
Expand Down
6 changes: 1 addition & 5 deletions src/obsidian/plugin/markdown-post-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 155732c

Please sign in to comment.