Skip to content

Conversation

@anengineer1
Copy link

Greetings!

I've been using YeetMouse's implementation of Custom Curve and I'm enjoying it a lot but if one feels limited when one tries to align the control points to achieve continuity between two segments so this merge request adds the ability to easily align.

The ability to modify the position of such control points via polar coordinates was also added. I was doubting whether or not show the angle as the scale of the axis varies independently but after some testing I think it is very useful.

Perhaps this video might better showcase the changes:

Screencast.From.2026-01-07.16-42-41.mp4

Thank you a lot.

@anengineer1 anengineer1 force-pushed the feature/custom-curve-draw branch 3 times, most recently from b832e8a to 197c8ac Compare January 7, 2026 20:50
gui/main.cpp Outdated
modified |= ImGui::DragFloat("##pos2x", &p1.x, 0.5, p_min, p_max);
ImGui::SameLine(0, g.Style.ItemInnerSpacing.x);
modified |= ImGui::DragFloat("##pos2y", &p1.y, 0.01, 0, 10);
ImGui::SameLine(0, g.Style.ItemInnerSpacing.x);
Copy link
Owner

Choose a reason for hiding this comment

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

shouldn't this SameLine only be called when the Button is created? (move inside the if below)

Copy link
Author

@anengineer1 anengineer1 Jan 8, 2026

Choose a reason for hiding this comment

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

You are right, I did amend the commit with the correction... I also addressed the line 699

@AndyFilter
Copy link
Owner

Hey, thanks for this feature! I always felt like the whole Custom Curve mode was kind of left behind.

The polar coordinate system implementation looks good! After looking at the video you attached I realized that this context window needs a bit of a UI overhaul, but that's outside the scope of this PR, and I'll leave this comment somewhere in my notes. The only thing I can suggest is to maybe put the "Magnitude" and "Angle" labels on top (like headers in a table), and then save some space by not having to add them to each line, like so:

Magnitude Angle
11.716 -175.124

(so like a table)

Besides that, all looks fine, I'll have a second look at it once I'll be able to run the code just to validate everything.

Thanks for the contribution!

- There is an align button
- There is the ability to change the the coordinates from cartesian to
  polar
@anengineer1 anengineer1 force-pushed the feature/custom-curve-draw branch from 197c8ac to a525b34 Compare January 8, 2026 09:46
@anengineer1
Copy link
Author

Hey, thanks for this feature! I always felt like the whole Custom Curve mode was kind of left behind.

My pleasure! Custom Curve is the one I'm using the most so I'm very happy to provide contributions like this, I hope people like it.

The polar coordinate system implementation looks good! After looking at the video you attached I realized that this context window needs a bit of a UI overhaul, but that's outside the scope of this PR, and I'll leave this comment somewhere in my notes. The only thing I can suggest is to maybe put the "Magnitude" and "Angle" labels on top (like headers in a table), and then save some space by not having to add them to each line, like so: [...]

I'll take a look at this then, this will require quite a bit of change regarding how the widgets are grouped. I will be on it as soon as I can.

@anengineer1
Copy link
Author

Ok, changed to a grid layout.

I decided not doing an amend this time in case we need to discuss further. I thought it is better and we can squash it later.

Here's a video/demo:

Screencast.From.2026-01-08.18-27-53.mp4

@anengineer1 anengineer1 force-pushed the feature/custom-curve-draw branch from ead1f3f to d35cdd7 Compare January 8, 2026 17:50
@anengineer1 anengineer1 force-pushed the feature/custom-curve-draw branch from d35cdd7 to 460a321 Compare January 8, 2026 17:54
Copy link
Owner

@AndyFilter AndyFilter left a comment

Choose a reason for hiding this comment

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

I also added upper and lower bounds to DragFloats so please test if it works well for you too.


struct Ex_Vec2 : ImVec2 {
bool is_locked = false;
bool use_polar_coordinates = false;
Copy link
Owner

Choose a reason for hiding this comment

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

I'm unsure whether this should be point-specific or global. Have you considered making this global, like show_custom_curve_control_points (and similar) in main.cpp? If so, what was the conclusion? If not, then please consider.


debug:
@echo "Building GUI for debugging..."
$(MAKE) all CXXFLAGS='-Wall -std=c++17 -g -O0 -I External/'
Copy link
Owner

Choose a reason for hiding this comment

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

I think it'd be better to break up the CXXFLAGS to separate the optimisation flags and modify just them. Then just build the CXXFLAGS from with the optimisation flags. In case anything will change to the compilation pipeline in the future.

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