Transform

Hi Dan,
I tried to limit the transform to a specific container, but it’s not working. I’ve attached an example.
I’d like to understand whether I’m doing something wrong or if this might be a bug.
Thanks, Hadas

let bounds = new Container(600, 400).center().outline();
let rect = new Rectangle(100, 100, red).center(bounds)
rect.transform({container: bounds });

The container parameter just tells the transform that it will be inside a container other than the stage. It does not set the boundary of the drag.

Here are some potential option:

thanks!

The example you sent me - Keeping Transform Within a Border, not work .
In all cases, the square returns to its initial position.
It seems that something in the hitTestRect check is not working as expected.

Oh - sorry, forgot that the bounds rectangle can't be clear in color to do the hittest - so it is now faint. And forgot to update the last object. That is fixed now...