rect w/ scaleFactor?

Dave Kilroy dave at applicationinsight.com
Mon Feb 9 16:03:20 EST 2015


Hi Richard - I had an issue about setting the loc of a stack with a
scaleFactor that would be calculated as the app opened (to make it close to
fullscreen). What I had to do was to apply the scaleFactor to the loc and
then set the loc of the stack to that - I should think the same would apply
to the stack's rect - apply the scaleFactor it it.

Here is my code from that app:

      --finding out about the screen
      put the screenRect into tScreenRectRaw
      put the working screenRect into tScreenRect
      put item 3 of tScreenRect into tScreenW
      put item 2 of tScreenRect - item 2 of tScreenRectRaw into
tMenuBarHeight
      put item 4 of tScreenRectRaw - item 4 of tScreenRect into
tTaskBarHeight
      put item 4 of tScreenRect - tMenuBarHeight into tScreenH

      --elsewhere I calculate what scaleFactor I need for the app, then I
set the stack to it
      set the scaleFactor of stack "Rewind" to tScaleFactor

      --loc for positioning the stack (before scaleFactor)
      put round(tScreenW/2,0) into tAppLocH 
      put 13 into tTitleBarHeight
      put tMenuBarHeight + tTitleBarHeight + round(tScreenH/2,0) into
tAppLocV         
      
      --loc for positioning the stack (including scaleFactor)
      put round(tAppLocH / tScaleFactor) into tAppLocH
      put round(tAppLocV / tScaleFactor) into tAppLocV
      set the loc of stack "Rewind" to tAppLocH & comma & tAppLocV



-----
"Some are born coders, some achieve coding, and some have coding thrust upon them." - William Shakespeare & Hugh Senior

--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/rect-w-scaleFactor-tp4688655p4688657.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the Use-livecode mailing list