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
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2006-05-29 17:01:51 +0400
committerTon Roosendaal <ton@blender.org>2006-05-29 17:01:51 +0400
commit2c7712dd84be06c8ef2843208c8ee2c6870e6c8e (patch)
tree4480a28e60d6d1ba513228a4fe0ef52cb2b7d164 /source/blender/src/transform.c
parenta416ec8978cb16a07a96039e8fe388dde9e2ef21 (diff)
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.
Diffstat (limited to 'source/blender/src/transform.c')
-rwxr-xr-xsource/blender/src/transform.c32
1 files changed, 16 insertions, 16 deletions
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
}