-
Notifications
You must be signed in to change notification settings - Fork 56
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
Issue 12 - Vector2 Refactor #21
Conversation
…ctor2, adding some extensions as needed.
…litz/murder into dev/issue12_Vector2Refactor
…rences is sorted alphabetically by filename). Mostly done.
…file to Vector2Helpers file.
There was a problem hiding this 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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same:
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
There was a problem hiding this 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!
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!