Skip to content
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

C# Truncate instead of round in Vector2/3/4 to Vector2I/3I/4I conversion #75477

Conversation

kleonc
Copy link
Member

@kleonc kleonc commented Mar 29, 2023

Makes C# Vector2/3/4 to Vector2I/3I/4I conversions behave consistently with the core, i.e. now they are performed by truncating to ins instead of rounding to ints like before. Also improved the relevant docs.

Fixes #75470.

Copy link
Member

@raulsntos raulsntos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a nit pick about the C# documentation.

modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2I.cs Outdated Show resolved Hide resolved
@kleonc kleonc force-pushed the csharp-fix-vector234i-from-floats-creation branch from 6fefe0c to f53d338 Compare March 31, 2023 08:59
@YuriSizov YuriSizov merged commit ce03630 into godotengine:master Mar 31, 2023
@YuriSizov
Copy link
Contributor

Thanks!

@kleonc kleonc deleted the csharp-fix-vector234i-from-floats-creation branch March 31, 2023 11:08
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.0.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

C# Vector2I inconsistent rounding behavior
4 participants