scaleFactor strangeness

Mark Waddingham mark at livecode.com
Wed Oct 14 16:53:26 EDT 2015


The HTML5 canvas doesn't have that problem - canvas is just a render target you can use 2d vector drawing commands on - it doesn't have any notion of objects.

SVG and HTML's object model has always been children's coords are relative to the parent so you have to think about coordinate systems when you code (assuming you are using transforms of any kind and are passing points between related objects and are actually scripting anything that relies on coords).

The problem is that (ignoring coords being integers in LC at the moment - which is also a problem) all current scripts that exist assume coords are relative to the card - and I'm not sure there's a way to bridge those two things in a transparent / easy way.

It is the scripting part that is the potential issue, rather than the rendering part.

LiveCode's message path encourages you to factor out common code into ancestors, and as such might receive coordinates from any descendent - and this would complicate scripting in any such situation if transforms were involved somewhere between the origin of the coordinate and where that coordinate is handled.

Then again, perhaps that is okay - it's a necessary tax on the scripter for using that feature.

Hmmmmmm.

Mark.



Sent from my iPhone

> On 14 Oct 2015, at 21:12, Richard Gaskin <ambassador at fourthworld.com> wrote:
> 
> Mark Waddingham wrote:
>>> On 2015-10-14 09:46, Richard Gaskin wrote:
>>> Maybe those could be handled as the HTML Canvas does, in which the
>>> coordinates you use remain the same and the scale factor takes case of
>>> the translation for us when rendering.
>> 
>> The problem is the mixture of co-ordinate systems on a card, if you have
>> a scaled button in a group and an unscaled button outside of a group -
>> how do coords work in an arbitrary script potentially unrelated to
>> either?
> 
> How is that handled in HTML's Canvas?  Is the SVG Canvas any different?
> 
> I don't want to talk you out of adding the stack viewer object if that's easier to do (that's the one thing I miss from Gain Momenum), but given how HTML5 and SVG allow different scales for different objects I'd favor any solution that reduces learning time for folks familiar with those popular solutions.
> 
> -- 
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> ____________________________________________________________________
> Ambassador at FourthWorld.com                http://www.FourthWorld.com
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list