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

Unexpected behavior for out-of-bounds filters #474

Open
BarberDuckyFazi opened this issue Oct 5, 2024 · 3 comments
Open

Unexpected behavior for out-of-bounds filters #474

BarberDuckyFazi opened this issue Oct 5, 2024 · 3 comments

Comments

@BarberDuckyFazi
Copy link

If a container to which the filter is applied is partially out of bounds, the filter can have unintended behavior.
Consider the reflection filter. The default point at which it switches from normal to "reflected" is at y = 0.5.

image

If we move the duck so that part of it is outside the viewport, the image we get is different:

image

The reason for this is that the filter is applied to the visible portion of the container.
However, what should one do to get the filter applied to the container as if it wasn't out of bounds? That is, the duck from the first picture, but translated up?
Is there even a way to get the position and size of the final filtered texture, so that we can at least compare it to the source container.

For example, in the above pictures, let's say that the original position of the duck sprite was [50, 50], with the size of [100, 100]. We then move it to [50, -50]. The filtered texture gets rendered at [50, 0], with size [100, 50]. Is there a way to get this "final" position of the filtered texture?

@bigtimebuddy
Copy link
Member

This may help in the coming pixi.js release: pixijs/pixijs#10923

@BarberDuckyFazi
Copy link
Author

Yep, saw it on dev docs a moment ago.
Thanks 😁

Is the release already scheduled? If so, where could I see the date?

@bigtimebuddy
Copy link
Member

Broken

https://jsfiddle.net/bigtimebuddy/tmjpovec/

Fixed

https://jsfiddle.net/bigtimebuddy/sfkah960/

It's unclear when the release will happen, but likely this week or next. In the meantime you can get the latest dev version by running.

npm install pixi.js@dev

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

No branches or pull requests

2 participants