Hi,
I’m experiencing an issue with the "transformed" event on mobile devices.
On desktop, the event works as expected. However, on mobile, the "transformed" event does not trigger on the first interaction. It only fires after touching the rectangle a second time.
My code:
let rect = new Rectangle(100, 100, purple)
.center()
rect.transform();
rect.on("transformed", function () {
zog("transformed rect:", rect.width, rect.height);
});
let rect2 = new Rectangle(100, 100, green)
.center().mov(0,200)
rect2.transform();
rect2.on("transformed", function () {
zog("transformed rect2:", rect2.width, rect2.height);
});
thanks 
It can also be reproduced on pc by switching the browser to mobile mode
Thanks, but I tried that too.
I tested this code:
new Frame(FIT, 1024, 768, light, dark, ready);
function ready() {
let rect = new Rectangle(100, 100, purple)
.center().transform();
const label = new Label().loc(100,100);
rect.on("transformed", function () {
label.text = "transformed rect:" + Math.round(rect.width) + " " + Math.round(rect.height);
S.update();
});
}
on android and ios and both worked as expected. The text in the Label changed on the first mouse up. Can you test here:
https://zimjs.com/test9/tr.html
What device and version?
1 Like
In the example you sent, there is only a single object being transformed, and in that case everything works smoothly.
In my example, there are two objects. In the attached video you can see by the zog
that when I switch from one object to the other, it takes two drag actions before the
transform event is triggered.
I am currently working with ZIM 019, but this also occurred in the previous version.
Ah... okay - will check it out tomorrow.
Interesting. If you start in desktop then go to mobile it works. But if you start in mobile then you need the two interactions before it triggers. We confirm, it is happening in the dev tools and on mobile. Looking into it.
Even if there is one object - the issue is when the controls are hidden and you press on them then the event does not fire until the second move. We see some suspect code - so testing now.
Okay fixed it.
Mobile does not get custom cursors by default and the dragReady was not being set at start - this later triggers a slight delay to capture transform move events when the controls are not initially showing. So... it seems to work fine if we set that for both custom or not. We tested and the event is still just triggering once for non-mobile.
This has been patched in ZIM 019