Re: screenloc not actually centered after changing scalefactor (was Screen Resolution for Desktop Apps)

2018-01-03 Thread Nicolas Cueto via use-livecode
Jacqueline yet again saves the day. Thank you!

--
N.

On 2 January 2018 at 08:34, J. Landman Gay via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 12/31/17 7:31 PM, Nicolas Cueto via use-livecode wrote:
>
>> To do "some calculations", I thought of comparing the loc to the
>> scalefactor. So ran the standalone on three devices, but saw no consistent
>> corelation between the differing locs and the scalefactor.
>>
>> So, still no clue what to use for these calculations...
>>
>
> My math skills are terrible so we need someone more clever to fix my
> calculation. But this seems to work for most scalefactors until you get
> down to about 0.6 or lower:
>
> on setloc pScale
>   -- pScale = the desired scaleFactor
>   put the screenloc into tSLoc
>   if pScale <= 1 then
> put 1 + (1-pScale) into tRatio
>   else
> put 1/pScale into tRatio
>   end if
>   put item 1 of tSLoc * tRatio into item 1 of tNewLoc
>   put item 2 of tSLoc * tRatio into item 2 of tNewLoc
>   set the scalefactor of this stack to pScale
>   set the loc of this stack to tNewLoc
> end setloc
>
> I'm pretty sure there's a way to calculate the ratio without the "if"
> clause so that it works for both large and small scales and I'm not sure
> why it breaks at about 0.6. Hopefully one of our math gurus can advise.
>
>
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com
>
> ___
> 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


Re: screenloc not actually centered after changing scalefactor (was Screen Resolution for Desktop Apps)

2018-01-01 Thread J. Landman Gay via use-livecode

On 12/31/17 7:31 PM, Nicolas Cueto via use-livecode wrote:

To do "some calculations", I thought of comparing the loc to the
scalefactor. So ran the standalone on three devices, but saw no consistent
corelation between the differing locs and the scalefactor.

So, still no clue what to use for these calculations...


My math skills are terrible so we need someone more clever to fix my 
calculation. But this seems to work for most scalefactors until you get 
down to about 0.6 or lower:


on setloc pScale
  -- pScale = the desired scaleFactor
  put the screenloc into tSLoc
  if pScale <= 1 then
put 1 + (1-pScale) into tRatio
  else
put 1/pScale into tRatio
  end if
  put item 1 of tSLoc * tRatio into item 1 of tNewLoc
  put item 2 of tSLoc * tRatio into item 2 of tNewLoc
  set the scalefactor of this stack to pScale
  set the loc of this stack to tNewLoc
end setloc

I'm pretty sure there's a way to calculate the ratio without the "if" 
clause so that it works for both large and small scales and I'm not sure 
why it breaks at about 0.6. Hopefully one of our math gurus can advise.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
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


Re: screenloc not actually centered after changing scalefactor (was Screen Resolution for Desktop Apps)

2018-01-01 Thread Dr. Hawkins via use-livecode
On Sun, Dec 31, 2017 at 5:31 PM, Nicolas Cueto via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
> To do "some calculations", I thought of comparing the loc to the
> scalefactor. So ran the standalone on three devices, but saw no consistent
> corelation between the differing locs and the scalefactor.
>
> I took a stab at it a few years ago, and failed.

I found no coherent relationship between the location on my iMac screen and
what livecode reported once I changed  the scaleFactor of the stack.  With
each 10% increase, the stack seems to move (usually) right, and also up or
down, possibly causing the menubar to be above the screen.

I also see an intermittent issue that livecode things the mouse pointer is
about an inch higher on the screen than it is, but the horizontal seems
correct.  This also seems be be limited to browse rather than select mode.


-- 
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
___
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


Re: screenloc not actually centered after changing scalefactor (was Screen Resolution for Desktop Apps)

2017-12-31 Thread Nicolas Cueto via use-livecode
> You may have to do some calculations based on the scalefactor, in order
to adjust the visual location.

Thanks Jacqueline, but still confused.

To do "some calculations", I thought of comparing the loc to the
scalefactor. So ran the standalone on three devices, but saw no consistent
corelation between the differing locs and the scalefactor.

So, still no clue what to use for these calculations...

On a perhaps related topic. Every time I start LC on that devpt PC
(Windows), the LC menu bar opens mostly hidden offscreen. So I have to drag
it left to be fully onscreen.

So, I guess if LC itself can't get it right, what hope is there for moi.

 ¡Feliz año nuevo!

​--
Nicolas Cueto​
___
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

Re: screenloc not actually centered after changing scalefactor (was Screen Resolution for Desktop Apps)

2017-12-28 Thread J. Landman Gay via use-livecode

On 12/27/17 9:19 PM, Nicolas Cueto via use-livecode wrote:

Problem is, after opening the standalone on different PCs the rescaling
fits the monitor, but the window is not centered despite the "set the loc
to screenloc" command.


It looks like the stack loc is being calculated at scalefactor 1, 
regardless of the actual scalefactor of the stack. You may have to do 
some calculations based on the scalefactor, in order to adjust the 
visual location.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
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


screenloc not actually centered after changing scalefactor (was Screen Resolution for Desktop Apps)

2017-12-27 Thread Nicolas Cueto via use-livecode
Following upon Jacqueline's advice on the original thread, here is my stack
script for modifying scalefactor based on monitor screenrect differences
(i.e., between the monitor I developed the stack and other monitors):

///
on preopenstack
   defaultStackAppearance
end preopenstack

on defaultStackAppearance
   lock screen
   set the fullscreen of this stack to false
   set the width of this stack to 1126
   set the height of this stack to 627

   -- Set to the lower of two screenrect-based ratios.
   -- On the monitor I developed this app,
   -- 1152 was item 3 (width) of the working screenrect and
   -- 682 was item 4 (height) of the working screenrect.

   put round((item 3 of the working screenrect) / 1152,2) into ratio_width
   put round((item 4 of the working screenrect) / 682,2) into ratio_height
   if ratio_width > ratio_height then
  -- current monitor is wider then devpt monitor, so set to height ratio
  set the scalefactor of this stack to ratio_height
   else
  -- current monitor is taller than devpt monitor, so set to width ratio
  set the scalefactor of this stack to ratio_width
   end if
   set the loc of this stack to the screenloc
   unlock screen
end defaultStackAppearance
///

Problem is, after opening the standalone on different PCs the rescaling
fits the monitor, but the window is not centered despite the "set the loc
to screenloc" command.

Suggestions?

Thank you.

--
Nicolas Cueto
___
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