I'm scaling an value and it works as I intend when the scale is 1 or greater but it doesn't seem to scale as intended when scaling down.
// increase by 10%
amount = 10
scale = 1
total = scale + amount/100
// decrease by 10%
amount = 10
scale = 1
total = scale - amount/100
I know this is easy but I'm blanking on this.
Work as intended meaning, I'm zooming in on an image and zoom in is a nice gradient but scaling down the image disappears in 9 steps. I would like it to scale gradually at a consistent rate.
Edit. I found this in my other class. I think it does what I want but is there be another way to write it?
scaleByAmount = amount/100
if (currentScale<=1) {
newScale = currentScale+currentScale*scaleByAmount;
}
else {
newScale = currentScale+scaleByAmount;
}
doesn't seem to scale as intendedDefine "as intended". – dxiv Feb 27 '18 at 06:47size*.1to zoom in andsize/.1to zoom out? – 1.21 gigawatts Feb 27 '18 at 07:41