As the screenrect is the same but virtually larger / smaller based on the 
scaleFactor you need calculate the scale factor based on the current 
scaleFactor and the new scaleFactor

Try this:
on changeScaleFactor pNewScale
   put the scaleFactor of this stack into tScale
   put tScale / pNewScale into tFactor
   put the topLeft of this stack into tTL
   multiply item 1 of tTL by tFactor
   multiply item 2 of tTl by tFactor
   set the scaleFactor of this stack to pNewScale
   set the topLeft of this stack to tTL
end changeScaleFactor

Of course you can substitute topLeft with something else if you want another 
corner or the center to be the fix point.

:-Håkan
On 16 Aug 2018, 01:11 +0200, Peter Bogdanoff via use-livecode 
<use-livecode@lists.runrev.com>, wrote:
> I too am using scaleFactor and ran into this issue of the difficulty of 
> windows moving around and even off screen. It seems that when scaleFactor is 
> invoked the entire screen is now virtual and calculations have to be made to 
> position the window where you want it to be visually. Unfortunately, those 
> exact calculations were beyond me at the time I implemented scaleFactor, so 
> my windows do still move somewhat. But if someone else has a method/formula 
> for window placement I too would be interested.
>
> Peter Bogdanoff
> ArtsInteractive
>
>
> > On Aug 15, 2018, at 3:02 PM, Knapp Martin via use-livecode 
> > <use-livecode@lists.runrev.com> wrote:
> >
> > I know that scaleFactor is not intended to be a "zoom view" feature for 
> > desktop, but in lieu of actually having zoom views, I really need to use it 
> > to allow the user to enlarge or reduce the window size for a Mac and 
> > Windows app I’m working on. What I would like is for it to shrink or grow 
> > from the topLeft point on the screen but I can't seem to figure out a way 
> > to keep it from jumping around. I would like to have scaleFactors from .5 
> > to 1.5. Anybody tackled this one?
> >
> > Thanks,
> > Marty
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your 
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to