Anim: don't include handles when calculating FCurve bounds in Graph Editor #120519

Merged
Christoph Lendenfeld merged 3 commits from ChrisLend/blender:graph_dont_calc_handles into main 2024-04-12 11:27:45 +02:00
1 changed files with 3 additions and 1 deletions

View File

@ -242,8 +242,10 @@ static void graph_main_region_draw(const bContext *C, ARegion *region)
graph_draw_curves(&ac, sipo, region, 1);
/* XXX(ton): the slow way to set tot rect... but for nice sliders needed. */
/* Excluding handles from the calculation to save performance. This cuts the time it takes for
* this function to run in half which is a major performance bottleneck on heavy scenes. */
get_graph_keyframe_extents(
&ac, &v2d->tot.xmin, &v2d->tot.xmax, &v2d->tot.ymin, &v2d->tot.ymax, false, true);
&ac, &v2d->tot.xmin, &v2d->tot.xmax, &v2d->tot.ymin, &v2d->tot.ymax, false, false);
/* extra offset so that these items are visible */
v2d->tot.xmin -= 10.0f;
v2d->tot.xmax += 10.0f;