Container issue with `updateTransform`
See original GitHub issueHello, I don’t know if I’m doing things wrong or it’s a bug.
Basic information
- PixiJS version: 4.4.3
Description
When a class extends PIXI.Container, it’s possible to use the updateTransform hook. But if inside the constructor you modify a PIXI.Container property, it will stop the construction of the object and will call updateTransform.
Thing is, if you read, for example, the same property setted on the constructor, it will create an infinite loop.
Here is a live example: http://codepen.io/lgraziani/pen/aJjwNZ?editors=0011
This is the basic class example:
class BunnyContainer extends PIXI.Container {
  constructor() {
    super();
    
    // PIXI.Container prop
    this.width = 100;
    // It will never reach here
    this.bunny = PIXI.Sprite.fromImage('http://pixijs.github.io/examples/required/assets/basics/bunny.png');
    this.bunny.anchor.x = 0.5;
    this.bunny.anchor.x = 0.5;
    this.bunny.position.y = this.bunny.position.x = 50;
    
    
    this.addChild(this.bunny);
  }
  updateTransform() {
    const bunnyPosition = this.width * 0.1;
    
    // It will never reach here
    this.bunny.position.x = bunyPosition;
  }
}
If is there anything I can help just tell me 😃
Thank you!
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
 Top Results From Across the Web
Top Results From Across the Web
Global shipping industry faces a new problem — too many ...
While there was a shortage of containers at the height of the Covid pandemic, the global economy is now facing the opposite problem:...
Read more >Can't run/start any docker container after update #597 - GitHub
I am not able to start any container after the update. Also a downgrade to 18.09.1 does not work :-( A general Ubuntu...
Read more >You might encounter issues when using Windows Server ...
You might encounter issues using Windows Server containers if the container host or container image has the February 11, 2020 security update, ...
Read more >docker container update
docker container update: Update configuration of one or more containers.
Read more >Why does the current container shortage happen?
What are the reasons for the container shortage? · Cause 1: Reduced number of available containers - The unprecedented reduction of the world...
Read more > Top Related Medium Post
Top Related Medium Post
No results found
 Top Related StackOverflow Question
Top Related StackOverflow Question
No results found
 Troubleshoot Live Code
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free Top Related Reddit Thread
Top Related Reddit Thread
No results found
 Top Related Hackernoon Post
Top Related Hackernoon Post
No results found
 Top Related Tweet
Top Related Tweet
No results found
 Top Related Dev.to Post
Top Related Dev.to Post
No results found
 Top Related Hashnode Post
Top Related Hashnode Post
No results found

spine uses updateTransform to animate some parts so its ok. just dont use “width” property, use some other name
Because
updateTransformis intended to prepare the object for rendering, you probably don’t want to be reading or changing the display tree within it.