diff --git a/tldraw/apps/tldraw-logseq/src/lib/preview-manager.tsx b/tldraw/apps/tldraw-logseq/src/lib/preview-manager.tsx index a962b5698..3ac1b0a68 100644 --- a/tldraw/apps/tldraw-logseq/src/lib/preview-manager.tsx +++ b/tldraw/apps/tldraw-logseq/src/lib/preview-manager.tsx @@ -15,7 +15,7 @@ const getShapeClass = (type: string): TLShapeConstructor => { export class PreviewManager { shapes: Shape[] | undefined - pageId: string | undefined; + pageId: string | undefined constructor(serializedApp?: TLDocumentModel) { if (serializedApp) { this.load(serializedApp) @@ -66,36 +66,35 @@ export class PreviewManager { {vBounds && ( <> - + )} - - {this.shapes?.map(s => { - const { - bounds, - props: { rotation }, - } = s - const [tx, ty] = translatePoint([bounds.minX, bounds.minY]) - const r = +((((rotation ?? 0) + (bounds.rotation ?? 0)) * 180) / Math.PI).toFixed(2) - const [rdx, rdy] = [(bounds.width / 2).toFixed(2), (bounds.height / 2).toFixed(2)] - const transformArr = [`translate(${tx}, ${ty})`, `rotate(${r}, ${rdx}, ${rdy})`] - return ( - - {s.getShapeSVGJsx(true)} - - ) - })} - - + + {this.shapes?.map(s => { + const { + bounds, + props: { rotation }, + } = s + const [tx, ty] = translatePoint([bounds.minX, bounds.minY]) + const r = +((((rotation ?? 0) + (bounds.rotation ?? 0)) * 180) / Math.PI).toFixed(2) + const [rdx, rdy] = [(bounds.width / 2).toFixed(2), (bounds.height / 2).toFixed(2)] + const transformArr = [`translate(${tx}, ${ty})`, `rotate(${r}, ${rdx}, ${rdy})`] + return ( + + {s.getShapeSVGJsx(true)} + + ) + })} + { const bounds = this.getBounds() return ( - - {text} - + +
+ {text} +
+
) } }