Skip to content

Commit

Permalink
Fix location computation
Browse files Browse the repository at this point in the history
  • Loading branch information
taku0 committed Jan 24, 2023
1 parent 5636221 commit cf2d37a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions data/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ class PieMenu {
*/
getCenter() {
const box = this.outer.getBBox();
const menuBox = this.menuNode.getBBox();
const transform = this.outer.getCTM();

const centerX = menuBox.x + box.width / 2;
const centerY = menuBox.y + box.height / 2;
const centerX = box.x + box.width / 2;
const centerY = box.y + box.height / 2;

return new Vector2D(centerX, centerY);
return new Vector2D(centerX, centerY).applyTransform(transform);
}

/**
Expand Down

0 comments on commit cf2d37a

Please sign in to comment.