Guigui220D / zig-sfml-wrapper

A zig wrapper for csfml
Other
49 stars 8 forks source link

incorrect behavior in setPosition #38

Closed IgorKorobeynikov closed 2 months ago

IgorKorobeynikov commented 2 years ago

with this: sprite.setPosition(.{ .x = 500, .y = 350 }); I get this: image But with this:

var vec = sf.Vector2f.new(500, 350);
sprite.setPosition(vec);

I get the expected result image

Guigui220D commented 2 years ago

Thanks for reporting! The two lines really shouldn't be different, Vector2f.new(...) does exactly what you do. I'm going to investigate this on my own pc and see if it happens here too, but it sounds to me like it's a bug outside my wrapper. It may be related with vector2f being a packed struct because I've heard packed struct have lots of bugs. If you have any new info, keep me updated ^^

IgorKorobeynikov commented 2 years ago

Thanks for reporting! The two lines really shouldn't be different, Vector2f.new(...) does exactly what you do. I'm going to investigate this on my own pc and see if it happens here too, but it sounds to me like it's a bug outside my wrapper. It may be related with vector2f being a packed struct because I've heard packed struct have lots of bugs. If you have any new info, keep me updated ^^

Thank you, I appreciate your work

IgorKorobeynikov commented 2 years ago

@Guigui220D I've been digging into the zig and raylib-zig repositories, and I seem to be sure that this problem is related to this: zig issue 1481 zig issue 10560

Guigui220D commented 2 months ago

Both issues were closed and the bug doesn't seem to happen anymore If it does let's reopen an issue