Skip to content

incorrect behavior in setPosition #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
IgorKorobeynikov opened this issue Jun 5, 2022 · 4 comments
Closed

incorrect behavior in setPosition #38

IgorKorobeynikov opened this issue Jun 5, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@IgorKorobeynikov
Copy link
Contributor

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
Copy link
Owner

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 Guigui220D added the bug Something isn't working label Jun 6, 2022
@IgorKorobeynikov
Copy link
Contributor Author

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
Copy link
Contributor Author

@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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants