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

Improve QOL by including additional addition/mutliplication arithmetic operators for ImVec2 #8258

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ArashPartow
Copy link

No description provided.

@ocornut
Copy link
Owner

ocornut commented Dec 23, 2024

Hello Arash,

My stance is that ImVec2 x float is justified but addition/subtraction isn’t. It’s an extremely rare and odd operation to perform, and adding those create a wider surface for mistakes being made and not reported by compilers. I don’t therefore believe they are a good idea.

Not having float x imvec2 is more arbitrary and arguable but since imvec2 x float is rare enough it felt like a legitimate trade off to explicitly only support one.

@ArashPartow
Copy link
Author

@ocornut I only added addition and multiplication. As subtraction would have a different meaning.

The idea was to allow for the following operations:

ImVec2 v1;
ImVec2 v2;

v1 = 1.234 + v2;
v1 = 1.234 * v2;

That being said, I'm happy to remove the addition operator from the PR. Let me know, otherwise feel free to close the PR.

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.

2 participants