You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
397 B

const s=n=>{if(Array.isArray(n.nodes)&&n.nodes.length>0){const t=n.nodes.map(e=>e.x),r=n.nodes.map(e=>e.y),a=Math.max.apply(null,t),l=Math.min.apply(null,t),o=Math.max.apply(null,r),c=Math.min.apply(null,r);return{drawWidth:a-l,drawHeight:o-c}}return{drawWidth:0,drawHeight:0}},i=n=>{const t=n.clientToLocal(1e3,1e3),r=t.x-1e3,a=t.y-1e3;return{x:r,y:a}};export{s as calcDrawSize,i as calcOffSet};