Animation: Improve drawing of locked FCurves #106052

Merged
Christoph Lendenfeld merged 12 commits from ChrisLend/blender:fcurve_locked_drawing into main 2023-07-07 15:05:58 +02:00
1 changed files with 1 additions and 1 deletions
Showing only changes of commit 12d7433b4d - Show all commits

View File

@ -234,7 +234,7 @@ static void draw_locked_keyframe_vertices(FCurve *fcu,
scale[0] /= vertex_size;
/* Dividing by the unit scale is needed to display euler correctly (internally they are radians
* but displayed as degrees) and all curves when normalization is turned on. */
scale[1] /= vertex_size / unit_scale;
scale[1] = scale[1] / vertex_size * unit_scale;

This is the same as:

scale[1] = scale[1] / (vertex_size / unit_scale);

which is the same as:

scale[1] = scale[1] * unit_scale / vertex_size;

which would remove a division from the computations. And since multiplication is faster than division, give a minute performance gain.

I'll leave it up to you to decide on which one you want (slightly longer but faster code, vs. slightly shorter and likely just as fast because the compiler can optimize). I don't have any strong feelings here.

This is the same as: ``` scale[1] = scale[1] / (vertex_size / unit_scale); ``` which is the same as: ``` scale[1] = scale[1] * unit_scale / vertex_size; ``` which would remove a division from the computations. And since multiplication is faster than division, give a minute performance gain. I'll leave it up to you to decide on which one you want (slightly longer but faster code, vs. slightly shorter and likely just as fast because the compiler can optimize). I don't have any strong feelings here.
set_fcurve_vertex_color(fcu, false);