Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2010-04-01 15:59:27 +0400
committerJoshua Leung <aligorith@gmail.com>2010-04-01 15:59:27 +0400
commitc6952f0450ad6df5f21f48049ec900863ea7ca92 (patch)
tree57b693843eb7015441f578f1d39f317a2fa34253 /source
parenta6f02e27d8047f4b1322093ce920b6e033626987 (diff)
Bugfix #21763: extremly zooming into graph editor via ctrl+mmb locks up blender
Curve sampling minimum 'sampling frequency' for display could get too low causing a hang (with really-slow convergence). Clamping with a coarses limit now.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/space_graph/graph_draw.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c
index 84df407109d..7f44df24a6e 100644
--- a/source/blender/editors/space_graph/graph_draw.c
+++ b/source/blender/editors/space_graph/graph_draw.c
@@ -523,19 +523,20 @@ static void draw_fcurve_curve (bAnimContext *ac, ID *id, FCurve *fcu, SpaceIpo *
* though it is impossible to predict this from the modifiers!
*
* If the automatically determined sampling frequency is likely to cause an infinite
- * loop (i.e. too close to FLT_EPSILON), fall back to default of 0.001
+ * loop (i.e. too close to 0), then clamp it to a determined "safe" value. The value
+ * chosen here is just the coarsest value which still looks reasonable...
*/
/* grid->dx is the first float in View2DGrid struct, so just cast to float pointer, and use it
* It represents the number of 'frames' between gridlines, but we divide by U.v2d_min_gridsize to get pixels-steps
*/
// TODO: perhaps we should have 1.0 frames as upper limit so that curves don't get too distorted?
samplefreq= *((float *)grid) / U.v2d_min_gridsize;
- if (IS_EQ(samplefreq, 0)) samplefreq= 0.001f;
+ if (samplefreq < 0.00001f) samplefreq= 0.00001f;
/* the start/end times are simply the horizontal extents of the 'cur' rect */
stime= v2d->cur.xmin;
- etime= v2d->cur.xmax;
+ etime= v2d->cur.xmax + samplefreq; /* + samplefreq here so that last item gets included... */
/* at each sampling interval, add a new vertex