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

Arithemic operators added for ImVec2 #5965

Closed
wants to merge 1 commit into from

Conversation

therealjoker4u
Copy link

Instead of doing this:

ImVec2 vec3 = ImVec2(vec1.x + vec2.x, vec1.y + vec2.y);
ImVec2 vec3 = ImVec2(vec1.x - vec2.x, vec1.y - vec2.y);
ImVec2 vec3 = ImVec2(vec1.x * vec2.x, vec1.y * vec2.y);
ImVec2 vec3 = ImVec2(vec1.x / vec2.x, vec1.y / vec2.y);
/// OR ->>>
ImVec2 vec3 = ImVec2(vec1.x + 10, vec1.y + 10);
ImVec2 vec3 = ImVec2(vec1.x - 10, vec1.y - 10);
ImVec2 vec3 = ImVec2(vec1.x * 10, vec1.y * 10);
ImVec2 vec3 = ImVec2(vec1.x / 10, vec1.y / 10);

Use the operators alternative:

ImVec2 vec3 = vec1 + vec2;
ImVec2 vec3 = vec1 - vec2;
ImVec2 vec3 = vec1 * vec2;
ImVec2 vec3 = vec1 / vec2;
/// OR ->>>
ImVec2 vec3 = vec1 + 10;
ImVec2 vec3 = vec1 - 10;
ImVec2 vec3 = vec1 * 10;
ImVec2 vec3 = vec1 / 10;

@ocornut
Copy link
Owner

ocornut commented Dec 8, 2022

Duplicate of #5966

@ocornut ocornut marked this as a duplicate of #5966 Dec 8, 2022
@ocornut ocornut closed this Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants