zig-sfml-wrapper icon indicating copy to clipboard operation
zig-sfml-wrapper copied to clipboard

incorrect behavior in setPosition

Open IgorKorobeynikov opened this issue 3 years ago • 3 comments

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

IgorKorobeynikov avatar Jun 05 '22 16:06 IgorKorobeynikov

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 ^^

Guigui220D avatar Jun 06 '22 07:06 Guigui220D

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 avatar Jun 06 '22 12:06 IgorKorobeynikov

@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

IgorKorobeynikov avatar Jun 26 '22 17:06 IgorKorobeynikov

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

Guigui220D avatar Jun 13 '24 10:06 Guigui220D