diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/view2d.c | 8 |
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; |