Tile scaleX (and scaleY) gives an incorrect value when it's negative and rotation is not equal to 0

var tile = new Tile(0, 0, 0, -1, 1, 0);
trace(tile.scaleX); // -1 - true

var tile = new Tile(0, 0, 0, -1, 1, 45);
trace(tile.scaleX); // 1 - false

var tile = new Tile(0, 0, 0, 1, -1, 0);
trace(tile.scaleY); // -1 - true

var tile = new Tile(0, 0, 0, 1, -1, 45);
trace(tile.scaleY); // 1 - false

Try this commit:

I believe it should preserve the rendering behavior, while also making the return values of scaleX, scaleY and rotation preserve negative values as desired

I’ve tried it with the newest dev versions of OpenFL and Lime and it has the same result as sooner.

I guess there are some troubles in Tile matrix geometry, because I have different behaviour on flash and not flash targets when I’m using matrix to change Tile inheritors parameters. And everything was ok while I used direct access to its properties like x,y, scaleX, scaleY.

Left - flash, right - neko.

https://gist.github.com/wolfhoundgelert/2eeb95162f6c442f3e50559b3785782f

https://gist.github.com/wolfhoundgelert/1fbf915ca2b1d808c8f99b8722d0bd4a

I think that the same bug https://github.com/openfl/openfl/issues/1240

I’ll try your commit.

I guess there are some troubles in Tile matrix geometry, because I have different behaviour on flash and not flash targets when I’m using matrix to change Tile inheritors parameters. And everything was ok while I used direct access to its properties like x,y, scaleX, scaleY.

Left - flash, right - neko.

A-HA-HA!

I’ve fixed it on not flash platforms with “matrix = matrix;” after “matrix.setTo(…);”

))))))))))

I love OpenFL and Haxe!))

Thank you guys!))

2 Likes