Help needed with scaleFactor and scaling

Dan Friedman dan at clearvisiontech.com
Sat Feb 18 13:08:46 EST 2017


Can anyone figure out the math to resize a control so it appears to be unchanged when you set the scaleFactor of a stack?  For example… you have a button who’s rect is 100,100,400,400.  On the screen, it looks to be 300px wide.  Now, if you set the scaleFactor to 1.5, what rect do you have to set the button to get it to “appear” to remain 300px wide?  At first, I thought it would simply be each item of the rect/scaleFactor.  But, that doesn’t do it.  I feels like you have to get the DPI of the active display and somehow use that as part of the equation.  Any ideas?

Thanks in advance,
-Dan



More information about the Use-livecode mailing list