resizing and rescaling an object: Is this math/logic ok?

Nicolas Cueto niconiko at gmail.com
Fri Jan 19 01:34:22 EST 2018


Given these values...

original STACK-width is tOSW
original stack-height is tOSH

resized stack-width is tRSW
resized stack-height of stack is tRSH

original  OBJECT rect is tOOR  (i.e., left,top,right,bottom)

... and assuming I'm right that ...

ratio of stack's width change is tRSWC and equals
round(tRSW / tOSW,2)

ratio of stack's height change is tRSHC and equals
round(tRSH / tOSH,2)




... then how (further?) wrong am I in assuming that, if I want the original
object resized and repositioned to scale on the new stack size, the NEW
RECT of that object therefore equals ...

round(item 1 of tOOR * tRSWC,0) , round(item 2 of tOOR * tRSHC,0) ,
round(item 3 of tOOR * tRSWC,0), round(item 4 of tOOR * tRSHC,0)


Sorry if that was painful. For what it's worth, I'm embarassed posting it,
but...

--
Nicolas Cueto



More information about the use-livecode mailing list