Nested masked objects break when going outside viewport (in certain conditions)
See original GitHub issueThe included playground demo explains it best, but to sum it up, when the following conditions are true, the mask on container C will be disabled when it moves out of the viewport:
- scissor masking is enabled
- masked container © is a child of a masked object (P)
- the parent container (P) contains at least one other object
This feels somewhat similar to #5974 (which was fixed a long time ago) but is obviously not exactly the same case.
Expected Behavior
Mask will never disable
Current Behavior
Mask disables when object leaves viewport
Possible Solution
Disable scissor masking
Steps to Reproduce
https://www.pixiplayground.com/#/edit/2qJVNoyRHDVPMtaTJ4hCY
Environment
pixi.js
version: 6.0.0 and up- Browser & Version: Tested in Windows 10 on FF, Chrome, and Edge, all have the same issue
- Running Example: https://www.pixiplayground.com/#/edit/2qJVNoyRHDVPMtaTJ4hCY
Issue Analytics
- State:
- Created 2 years ago
- Comments:33 (10 by maintainers)
Top Results From Across the Web
Masking works in viewport and preview, not in export.
I got this background line that is masked so it doesn't intersect with the foreground object ('Reveal all' on the group, then 'Subtract'...
Read more >Nested Viewports - Autodesk Community - AutoCAD
Does anyone know how to mask objects in nested viewports? The back viewport objects show through the front viewport. Thanks!
Read more >The stacking context - CSS: Cascading Style Sheets | MDN
The stacking context is a three-dimensional conceptualization of HTML elements along an imaginary z-axis relative to the user, who is assumed ...
Read more >Nested div masked off by circular container div - css
In my experience, you can't get it to do this with straight css. Things "spill out" of the border-radius. ... Do you have...
Read more >Trim objects in the Timeline in Motion - Apple Support
In Motion, trim an object's timebar when you want to shorten or lengthen its duration. ... Timeline showing an object being trimmed, revealing...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
yes, that’s the difference. double-destroy works in v4.5 but not in v4.8
Suppose you called
sprite.destroy()
(important: NO PARAMS) , two times. v4.5 works fine, v4.8 breaks because of this line: https://github.com/pixijs/pixijs/blob/fc2248c5df12cf2273ddafdccbe6eb19c33b73eb/src/core/sprites/Sprite.js#L441v6 should break same way. I advice you to override destroy, because that’s completely different topic of discussion and will take long time to negotiate with others (whether this behaviour is ok)
so its something like double-destroy, that worked in 4.5.3 but not working in 4.8.9, let me try