Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BevelFilter rotation defaults to 0° instead of 45° #456

Closed
plurry opened this issue Apr 14, 2024 · 2 comments · Fixed by #457
Closed

BevelFilter rotation defaults to 0° instead of 45° #456

plurry opened this issue Apr 14, 2024 · 2 comments · Fixed by #457

Comments

@plurry
Copy link

plurry commented Apr 14, 2024

The constructor ignores the rotation value, but setting it after initialization works: https://jsfiddle.net/3anhs0pw/

Also, to be consistent, I think rotation values should be in radians like in Pixi, while angle values would be in degrees.

@plurry
Copy link
Author

plurry commented Apr 15, 2024

This bug isn't there with Pixi 7 and Filters 5: https://jsfiddle.net/buo96kmv/

I haven't built it and made sure that this is the problem, but It looks like it's a degrees-to-radians conversion bug. rotation is multiplied by DEG_TO_RAD once when it's initialized:

const rotation = (options.rotation ?? 45) * DEG_TO_RAD;

and then again when Object.assign calls the setter:
Object.assign(this, options, { rotation });
set rotation(value: number)
{
this._rotation = value * DEG_TO_RAD;
this._updateTransform();
}

@bigtimebuddy
Copy link
Member

Good catch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants