From 592ed2c812bb760109ded411cf4616d84979f90d Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Tue, 18 Dec 2007 23:27:26 +0000 Subject: [PATCH] Fixed bug #7960, Sculpt Mode: Crash after Scaling brush to 1 ("Tile" mode) Division by zero fix --- source/blender/src/sculptmode.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/blender/src/sculptmode.c b/source/blender/src/sculptmode.c index 8afd1dafd6a..7dd668e1acb 100644 --- a/source/blender/src/sculptmode.c +++ b/source/blender/src/sculptmode.c @@ -857,8 +857,10 @@ float tex_strength(EditData *e, float *point, const float len,const unsigned vin px= len * cos(angle) + 2000; py= len * sin(angle) + 2000; } - px %= sx-1; - py %= sy-1; + if(sx != 1) + px %= sx-1; + if(sy != 1) + py %= sy-1; p= get_texcache_pixel(ss, tcw*px/sx, tch*py/sy); } else { float fx= (pv.co[0] - e->mouse[0] + half) * (tcw*1.0f/bsize) - tcw/2;