tzachshabtay / MonoAGS

AGS (Adventure Game Studio) reimagined in Mono
https://tzachshabtay.github.io/MonoAGS/
Artistic License 2.0
27 stars 8 forks source link

Object scaling works incorrectly with Anchor? #169

Closed ghost closed 6 years ago

ghost commented 6 years ago

It seems to me that the scaling operation treats image's Anchor incorrectly, at least for room objects.

Description of an anchor sais: "The units of the anchor point is in relation for the image size, where (0f,0f) is the bottom-left corner, and (1f,1f) is the top-right corner.", which means (0.5f, 0.5f) is the center of image. That makes perfect sense.

However, setting scaling to object produces unexpected results.

For example: with default anchor (0.5, 0), scaling an object horizontally makes its image appear shifted to the left, proportionally to the scale value, while normally I'd think it stays centered to the same position in the room. If I set Anchor as (0, 0), scaled object stays on same place.

tzachshabtay commented 6 years ago

I reproduced this, definitely a bug, it used to work, and I probably broke something in recent commits. I'll work on it soon.

tzachshabtay commented 6 years ago

@ivan-mogilko should work now, let me know if it matches what you expect.