Skip to content

Commit

Permalink
fix: adjust button tool matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
Qinghui.Liu authored and Qinghui.Liu committed Apr 25, 2024
1 parent 1a27a2a commit 4d03951
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/x6/src/registry/tool/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@ export class Button extends ToolsView.ToolItem<
x = NumberExt.normalizePercentage(x, bbox.width)
y = NumberExt.normalizePercentage(y, bbox.height)

let matrix = Dom.createSVGMatrix().translate(
bbox.x + bbox.width / 2,
bbox.y + bbox.height / 2,
)
const origin = this.parent.options.local ? [bbox.width / 2, bbox.height / 2] : [bbox.x + bbox.width / 2, bbox.y + bbox.height / 2];

let matrix = Dom.createSVGMatrix().translate(origin[0], origin[1])

if (rotate) {
matrix = matrix.rotate(angle)
Expand Down

0 comments on commit 4d03951

Please sign in to comment.