Renderer sets parent back to old value before calling render() on display-object
See original GitHub issueI was having trouble with getBounds
during a render pass onto a render-texture; I traced it to this part in Renderer
:
if (!skipUpdateTransform)
{
// update the scene graph
const cacheParent = displayObject.parent;
displayObject.parent = this._tempDisplayObjectParent;
displayObject.updateTransform();
displayObject.parent = cacheParent;
// displayObject.hitArea = //TODO add a temp hit area
}
this.renderTexture.bind(renderTexture);
this.batch.currentRenderer.start();
if (clear !== undefined ? clear : this.clearBeforeRender)
{
this.renderTexture.clear();
}
displayObject.render(this);
If getBounds()
is called on a display-object, it will re-update its transform with its real parent. We don’t want that to happen when rendering to a render-texture.
Was this the intended behavior? Or could we move displayObject.parent = cacheParent
after calling displayObject.render
.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Renderer sets parent back to old value before calling render() on ...
I was having trouble with getBounds during a render pass onto a render-texture; I traced it to this part in Renderer: if (!...
Read more >PIXI.DisplayObject - PixiJS
This the axis-aligned bounding box in the parent's local space. See getLocalBounds() . Render Bounds, The bounds, but including extra rendering ...
Read more >openfl.display.DisplayObject - API Reference
The DisplayObject class is the base class for all objects that can be placed on the display list. The display list manages all...
Read more >DisplayObjectContainer - Starling Framework Reference
It is the base class of all display objects that act as a container for other objects. By maintaining an ordered list of...
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
That’s why we have
getBounds(rect, false)
But yes, you are right, its a bug.Probably its a bug that i’ve been searching for for a long time.
Now we need PR and a test for it, I’ll do it 😃
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.