Skip to content

Commit

Permalink
fix: polygon`s transform should use worldTransform
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodyfunk authored and F-star committed Jul 11, 2024
1 parent eff71fa commit 492b5bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ dist
npm-debug.log*
yarn-debug.log*
yarn-error.log*

.history
6 changes: 4 additions & 2 deletions packages/core/src/graphs/regular_polygon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,11 @@ export class SuikaRegularPolygon extends SuikaGraphics<RegularPolygonAttrs> {
},
) {
const attrs = this.attrs;
const { fill, strokeWidth, stroke } = overrideStyle || this.attrs;
const { fill, strokeWidth, stroke, transform } =
overrideStyle || this.attrs;

ctx.save();
ctx.transform(...attrs.transform);
ctx.transform(...(transform ?? attrs.transform));

const points = this.getPoints();

Expand Down Expand Up @@ -130,6 +131,7 @@ export class SuikaRegularPolygon extends SuikaGraphics<RegularPolygonAttrs> {
}
}
}

if (strokeWidth) {
ctx.lineWidth = strokeWidth;
for (const paint of stroke ?? []) {
Expand Down

0 comments on commit 492b5bf

Please sign in to comment.