From 1fa55b75f0e3b1acf1245362cebaf5baa86f93f7 Mon Sep 17 00:00:00 2001 From: Ash Tyndall Date: Sat, 22 Oct 2011 10:19:11 +0800 Subject: [PATCH] --- scene.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scene.c b/scene.c index f87412d..fe7eca3 100644 --- a/scene.c +++ b/scene.c @@ -308,13 +308,13 @@ void motion(int x, int y) { // For big/small scaling, we map negative numbers to 0->1 and positive numbers to 1->inf float diff = (y - starty); - float map = (diff - -((float)height/2))/(0 - -((float)height/2)); + float map = ( diff + (float)height/2 ) / ( (float)height/2 ); float scaling; if ( diff < 0 ) { scaling = map; } else { - scaling = pow(1.0/map, diff); + scaling = pow(map, diff); } if ( scaling != 0 ) { @@ -323,7 +323,7 @@ void motion(int x, int y) { sceneObjs[curObject].scale[0] *= scaling; sceneObjs[curObject].scale[1] *= scaling; sceneObjs[curObject].scale[2] *= scaling; - printf("Diff is %f, Scaling by %f on all axii, 1/map is %f\n", diff, sceneObjs[curObject].scale[0], 1/map); + printf("Diff is %f, Scaling by %f on all axii, 1/map is %f\n", diff, sceneObjs[curObject].scale[0], map); } -- 2.20.1