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:
authorTon Roosendaal <ton@blender.org>2011-01-03 21:57:13 +0300
committerTon Roosendaal <ton@blender.org>2011-01-03 21:57:13 +0300
commit5eaad696e888fc5b6296c4fa855b0102cdf78187 (patch)
treea641b3e54edee4a60a64b5002023c34b6f9a5c61 /source
parent6b82aa8d015adae51c3d83fc881f21e8cda95c5d (diff)
Bugfix, own collection
Graph editor: sliding Nkey Properties to left, closing curves view entirely, was hanging in eternal loop. Caused by division by zero.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/view2d.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 2b527823ac3..628a7cbab51 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -1133,9 +1133,11 @@ View2DGrid *UI_view2d_grid_calc(Scene *scene, View2D *v2d, short xunits, short x
space= v2d->cur.xmax - v2d->cur.xmin;
pixels= (float)(v2d->mask.xmax - v2d->mask.xmin);
- grid->dx= (U.v2d_min_gridsize * space) / (seconddiv * pixels);
- step_to_grid(&grid->dx, &grid->powerx, xunits);
- grid->dx *= seconddiv;
+ if(pixels!=0.0f) {
+ grid->dx= (U.v2d_min_gridsize * space) / (seconddiv * pixels);
+ step_to_grid(&grid->dx, &grid->powerx, xunits);
+ grid->dx *= seconddiv;
+ }
if (xclamp == V2D_GRID_CLAMP) {
if (grid->dx < 0.1f) grid->dx= 0.1f;