Reputation: 25
I have a container and I have added a couple of bitmaps to it and scaled the whole container. Now when I call getTransformedBounds() on it, it returns null.
let innerContainer = new createjs.Container();
innerContainer.addChild(bitmap1);
innerContainer.addChild(bitmap2);
innerContainer.scaleX=scale;
innerContainer.scaleY=scale;
let phBounds = innerContainer.getTransformedBounds();
Here phBounds is null. It was working all these days. Suddenly today it is returning null. Strange. Any help greatly appreciated.
Upvotes: 0
Views: 576
Reputation: 2488
Did you wait for the Bitmap
image to load? If not, the bounds will be null because there is no content to measure. I wrote a quick test, and everything looks like its working fine:
https://codepen.io/gskinner/pen/bWEoaQ
Upvotes: 1