سؤال

I'am scaling a stage for example the scale value is decreasing like:

1
0.9
0.8
0.7
0.6
0.5

I want to make an inversion of this values, to increase the scale of the objects in the stage like:

1
1.1
1.2
1.3
1.4
1.5

what is the best way to do this? or is there a formula calculation for this?

هل كانت مفيدة؟

المحلول

Just divide 1 on the scale

If you had 10, scaled it by 0.8 and want it back:

size = 10 *0.8= 8

and back:

size = 8 *(1 / 0.8)= 10

Just remember to do it in reverse order if you scale multiple times as scale is accumulated (scale x newScale).

0.9
0.8
0.7
0.6
0.5

to get it back to start:

1/0.5
1/0.6
1/0.7
1/0.8
1/0.9

A small proof-of-concept.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top