X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=scene.c;h=fcbda4ab692c7657f8dd1cc88d2922f96707d038;hb=5bf3130b1623b0f243454f7be5a970e6772b18f5;hp=3f2c2ab4e235d68041db566e04aa5e1b014434ce;hpb=ab838687c0439bc042cf3818fd7dcba9c23963a4;p=atyndall%2Fcits2231.git diff --git a/scene.c b/scene.c index 3f2c2ab..fcbda4a 100644 --- a/scene.c +++ b/scene.c @@ -308,12 +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 scaling; if ( diff < 0 ) { - scaling = (diff - -((float)height/2))/(0 - -((float)height/2)); + scaling = map; } else { - scaling = diff; + scaling = pow(1.0/map, diff); } if ( scaling != 0 ) {