scaleFactor strangeness

Mark Waddingham mark at livecode.com
Thu Oct 15 11:35:34 EDT 2015


On 2015-10-15 16:45, hh wrote:
> The scalefactor SF of a button in a (non-background-) group on a card 
> is then
> 
> SF(stack) * SF(card) * SF(group) * SF(button).

The problem I am concerned about is actually the differing co-ordinate 
systems at each level here and how that affects script - this proposal 
is identical to anything which offers the ability to set a transform on 
any object and so still suffers from it.

> It's really simple, isn't it? And it works ...

Of course, posed as you have, it has made me realize that there is a 
potentially feasible option right now.

We already have the 'fullScreenMode' property - which controls the 
transform from 'card-space' to 'window-space'. This acts on the entire 
content of the card and thus doesn't have a problem with any translation 
of co-ordinate systems (as they don't change within the card).

What we didn't do was add the option of controlling this mapping 
directly and have the result displayed in a window. This could be done 
by adding a property which specifies the region of the card rect you 
want stretched to fill the window.

So if your stack is 400x400 and you want to display the middle portion 
(100,100,300,300); then you'd set something like:

set the visibleRect of stack ... to "100,100,300,300"

This would scale and translate the 200x200 middle rectangle to fill the 
entire window.

The reason this is unaffected by my concerns about the action of script 
in such an environment is that script actions are contained entirely 
within the stack and objects within it. The co-ordinate transform 
boundary happens between the OS and the window essentially - which is at 
the globalLoc / localLoc level - the thing that changes is the mapping 
between what script considers to be 'card-relative' (local) and 
'screen-relative' (global). Script already has to take this into 
account, as does the engine (which it does, otherwise fullScreenMode 
wouldn't work).

Warmest Regards,

Mark.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the use-livecode mailing list