From 2c7712dd84be06c8ef2843208c8ee2c6870e6c8e Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 29 May 2006 13:01:51 +0000 Subject: Fix #4245 Old annoyance in Blender; zooming in very far makes scaling/rotate around invisible pivot going bezerk. The easy fix was just enforcing floats in integer math. --- source/blender/src/transform.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'source/blender/src/transform.c') diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c index 942652de47b..77dad5fb1e8 100755 --- a/source/blender/src/transform.c +++ b/source/blender/src/transform.c @@ -1318,11 +1318,11 @@ int Shear(TransInfo *t, short mval[2]) void initResize(TransInfo *t) { - t->fac = (float)sqrt( (float) + t->fac = (float)sqrt( ( - (t->center2d[1] - t->imval[1])*(t->center2d[1] - t->imval[1]) + ((float)(t->center2d[1] - t->imval[1]))*((float)(t->center2d[1] - t->imval[1])) + - (t->center2d[0] - t->imval[0])*(t->center2d[0] - t->imval[0]) + ((float)(t->center2d[0] - t->imval[0]))*((float)(t->center2d[0] - t->imval[0])) ) ); if(t->fac==0.0f) t->fac= 1.0f; // prevent Inf @@ -2412,11 +2412,11 @@ void initCrease(TransInfo *t) t->snap[1] = 0.1f; t->snap[2] = t->snap[1] * 0.1f; t->transform = Crease; - t->fac = (float)sqrt( (float) + t->fac = (float)sqrt( ( - (t->center2d[1] - t->imval[1])*(t->center2d[1] - t->imval[1]) + ((float)(t->center2d[1] - t->imval[1]))*((float)(t->center2d[1] - t->imval[1])) + - (t->center2d[0] - t->imval[0])*(t->center2d[0] - t->imval[0]) + ((float)(t->center2d[0] - t->imval[0]))*((float)(t->center2d[0] - t->imval[0])) ) ); if(t->fac==0.0f) t->fac= 1.0f; // prevent Inf @@ -2699,11 +2699,11 @@ void initBoneSize(TransInfo *t) t->snap[1] = 0.1f; t->snap[2] = t->snap[1] * 0.1f; t->transform = BoneSize; - t->fac = (float)sqrt( (float)( - (t->center2d[1] - t->imval[1])*(t->center2d[1] - t->imval[1]) - + - (t->center2d[0] - t->imval[0])*(t->center2d[0] - t->imval[0]) - ) ); + t->fac = (float)sqrt( ( + ((float)(t->center2d[1] - t->imval[1]))*((float)(t->center2d[1] - t->imval[1])) + + + ((float)(t->center2d[0] - t->imval[0]))*((float)(t->center2d[0] - t->imval[0])) + ) ); if(t->fac==0.0f) t->fac= 1.0f; // prevent Inf } @@ -2775,11 +2775,11 @@ void initBoneEnvelope(TransInfo *t) t->snap[1] = 0.1f; t->snap[2] = t->snap[1] * 0.1f; t->transform = BoneEnvelope; - t->fac = (float)sqrt( (float)( - (t->center2d[1] - t->imval[1])*(t->center2d[1] - t->imval[1]) - + - (t->center2d[0] - t->imval[0])*(t->center2d[0] - t->imval[0]) - ) ); + t->fac = (float)sqrt( ( + ((float)(t->center2d[1] - t->imval[1]))*((float)(t->center2d[1] - t->imval[1])) + + + ((float)(t->center2d[0] - t->imval[0]))*((float)(t->center2d[0] - t->imval[0])) + ) ); if(t->fac==0.0f) t->fac= 1.0f; // prevent Inf } -- cgit v1.2.3