-
-
Notifications
You must be signed in to change notification settings - Fork 23.7k
Refactor CurveEdit to use consistent world/view transforms
#77622
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
Conversation
|
For reference, "World" is the space of the curve, i.e. x from 0 to 1, and y = f(x). "View" is the pixel coordinates of stuff on the screen, relative to the top left corner of the curve editor. |
fbfa331 to
f49be2b
Compare
862a1d0 to
27dbf0c
Compare
|
Looks good to me |
27dbf0c to
7f9b1ba
Compare
Currently, `CurveEdit` uses a couple of different ways to ensure that points and lines are drawn in the right space. This makes the code harder to understand and maintain. This PR makes the curve be drawn in view coordinates by transforming every point from world/curve-space into view-space. By drawing in view-space, we can keep enable anti-aliasing and use a single way to transform coordinates from the two different spaces.
7d419e9 to
67be52b
Compare
|
Rebased. This has been reviewed & tested by the person who last worked intensely on the curve editor. It is on the path towards #67857, which has decent support and I'd like to revive since I need it for myself :) Do we need reviews from someone else? |
|
Closed as included in #67857. |
Currently,
CurveEdituses a couple of different ways to ensure that points and lines are drawn in the right space. This makes the code harder to understand and maintain.This PR makes the curve be drawn in view coordinates by transforming every point from world/curve-space into view-space. This ensures there is a single way to scale from curve-space to view-space and vice-versa. By drawing in view-space, we can keep anti-aliasing, which was the main point of the previous changes! 🥳
Other minor changes, resulting in fewer lines of code overall:
plot_curve_accuratetoCurveEditso it can make use of_world_to_viewtransform and related functionsconst Vector2 &