Help needed with scaleFactor and scaling

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Help needed with scaleFactor and scaling

hh via use-livecode
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
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help needed with scaleFactor and scaling

hh via use-livecode
This seems to work (to make button 1 appear to be 100 pixels from the top and left, and to appear to be 200 wide and 150 tall):

on fixit
   put random(10)/10 + 1 into it
   set the scalefactor of this stack to it
   set the rect of btn 1 to 100/it,100/it,100/it+100/it,100/it+50/it
end fixit



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Loading...