Skip to content

Commit

Permalink
fix: consider transform when calc bbox
Browse files Browse the repository at this point in the history
  • Loading branch information
NewByVector committed Jul 13, 2023
1 parent a9aa2b8 commit a04e9a5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/x6/src/util/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,14 @@ export namespace Util {
}

const shape = toGeometryShape(node)
return shape.bbox() || Rectangle.create()
const bbox = shape.bbox() || Rectangle.create()
const transform = node.getAttribute('transform')

if (transform) {
const nodeMatrix = Dom.transformStringToMatrix(transform)
return transformRectangle(bbox, nodeMatrix)
}

return bbox
}
}

0 comments on commit a04e9a5

Please sign in to comment.