Browse Source

fix: align method

Konstantinos Kaloutas 3 years ago
parent
commit
7c5afa979b
1 changed files with 3 additions and 2 deletions
  1. 3 2
      tldraw/packages/core/src/lib/TLApp/TLApp.ts

+ 3 - 2
tldraw/packages/core/src/lib/TLApp/TLApp.ts

@@ -382,10 +382,11 @@ export class TLApp<
     if (shapes.length < 2) return this
     if (shapes.length < 2) return this
 
 
     const boundsForShapes = shapes.map((shape) => {
     const boundsForShapes = shapes.map((shape) => {
+      const bounds = shape.getBounds();
       return {
       return {
         id: shape.id,
         id: shape.id,
-        point: shape.getCenter(),
-        bounds: shape.getBounds(),
+        point: [bounds.minX, bounds.minY],
+        bounds: bounds,
       }
       }
     })
     })