diff --git a/src/ExcalidrawAutomate.ts b/src/ExcalidrawAutomate.ts index c986110..731ae85 100644 --- a/src/ExcalidrawAutomate.ts +++ b/src/ExcalidrawAutomate.ts @@ -306,26 +306,21 @@ export async function initExcalidrawAutomate(plugin: ExcalidrawPlugin) { pushPoint(i,-1); } p.push(p[0]); - const id=this.addLine(p); - const scale = (element:ExcalidrawElement):ExcalidrawElement => { - if(!(element.type=="line" || element.type=="arrow")) return null; - const scaleX = width/element.width; - const scaleY = height/element.height; + const scale = (p:[[x:number,y:number]]):[[x:number,y:number]] => { + const box = getLineBox(p); + const scaleX = width/box.w; + const scaleY = height/box.h; let i; - for(i=0;i