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

Issue 12 - Vector2 Refactor #21

Merged

Conversation

dgoelitz
Copy link
Contributor

This replaces all occurrences of Murder.Core.Geometry.Vector2 with System.Numerics.Vector2. Reimplemented methods and properties from the old Vector2 as needed. Extension methods are in Vector2Extensions and helpers that do not use 'this' are in Vector2Helper. Some properties needed to become methods because there is no support for extension properties in C# yet. Many properties and methods from the old Vector2 I did not implement in the new one because they were not being used, as discussed.

I tried not to insert myself too much and leave things stylistically the same. That said, I sorted and removed usings in every file I touched. This was a lot of fun. Thanks for letting me help!

@dgoelitz dgoelitz marked this pull request as ready for review September 20, 2023 00:22
@isadorasophia isadorasophia changed the base branch from main to feature/vector2 September 20, 2023 05:16
Copy link
Owner

@isadorasophia isadorasophia left a comment

Choose a reason for hiding this comment

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

Beautiful 🙏

@@ -414,7 +415,7 @@ private void DrawSelectionTween(RenderContext render)
float startAlpha = .9f;
Color color = Game.Profile.Theme.Accent * (startAlpha - startAlpha * tween);

Vector2 size = _selectionBox + expand * 2;
Copy link
Owner

Choose a reason for hiding this comment

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

can we override the overload operator? I think that's possible with an extension method

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure, this says no https://stackoverflow.com/questions/172658/operator-overloading-with-c-sharp-extension-methods. But let me know if you find out otherwise

{
ImGui.PushStyleVar(ImGuiStyleVar.FrameBorderSize, 1f);
ImGui.PushStyleVar(ImGuiStyleVar.SelectableTextAlign, new System.Numerics.Vector2(.5f, .5f));
public static bool PrettySelectableWithIcon(string label, bool selectable)
Copy link
Owner

Choose a reason for hiding this comment

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

we need to fix these extra 😁

Camera.Position.Point.X - Camera.Position.X - CAMERA_BLEED / 2,
Camera.Position.Point.Y - Camera.Position.Y - CAMERA_BLEED / 2) *
scale).Point;
var cameraAdjust = new Vector2(
Copy link
Owner

Choose a reason for hiding this comment

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

same:

Copy link
Owner

Choose a reason for hiding this comment

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

(probably just format this file)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh I think these were from sorting out a merge conflict where the competing change restyled the namespace like that changing the tabbing which I didn't pick up in the merge. You guys got all these changes? Sorry I was asleep haha

Copy link
Collaborator

@saint11 saint11 left a comment

Choose a reason for hiding this comment

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

Thank you! I changed this to a feature branch (isadorasophia:feature/vector2) so I can make some final adjustments before merging this into main with your commits!

@saint11 saint11 merged commit 3136984 into isadorasophia:feature/vector2 Sep 20, 2023
@dgoelitz dgoelitz deleted the dev/issue12_Vector2Refactor branch September 20, 2023 19:20
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.

None yet

3 participants