fix: return valid empty bounds from empty Graphics (#11908)
- fix: return valid empty bounds from empty Graphics
When a Graphics object has no drawing instructions, its bounds remain in the cleared state (minX=Infinity, minY=Infinity, maxX=-Infinity, maxY=-Infinity). When these invalid bounds are multiplied by a rotation matrix in parent bounds calculation, they produce ±Infinity results that contaminate the parent’s bounds.
This fix ensures that empty Graphics returns (0, 0, 0, 0) bounds instead of Infinity values, allowing parent containers with rotated empty Graphics children to compute bounds correctly.
Fixes: #11897
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
- fix: Removes incorrect child bounds test
Removes a test case that expected empty graphics to inherit child bounds
The test was checking behavior that doesn’t align with the intended graphics bounds functionality. When a graphics object is empty, it shouldn’t automatically adopt its children’s bounds.
Co-authored-by: Claude Opus 4.6 noreply@anthropic.com Co-authored-by: Zyie 24736175+Zyie@users.noreply.github.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
Guides | Tutorials | Examples | API Docs | Discord | Bluesky | 𝕏
PixiJS ⚡️
PixiJS is the fastest, most lightweight 2D library available for the web, working across all devices and allowing you to create rich, interactive graphics and cross-platform applications using WebGL and WebGPU.
Setup
It’s easy to get started with PixiJS! Just use our PixiJS Create CLI and get set up in just one command:
or to add it to an existing project:
Usage
Contribute
Want to be part of the PixiJS project? Great! All are welcome! We will get there quicker together :) Whether you find a bug, have a great feature request, or you fancy owning a task from the road map above, feel free to get in touch.
Make sure to read the Contributing Guide before submitting changes.
License
This content is released under the MIT License.
Change Log
Releases
Support
We’re passionate about making PixiJS the best graphics library possible. Our dedication comes from our love for the project and community. If you’d like to support our efforts, please consider contributing to our open collective.