[Topic][Dumbfounded] Is there a way to resize and move a group without touching the inside objects

Thomas McGrath III mcgrath3 at mac.com
Fri May 10 22:01:11 EDT 2013


Geoff,

What you state here about the rounding is exactly what I have been seeing and your suggestion that one should always start from the stored original sizes and attributes when cumulative resizes or back to back resizes are needed is the only solution so far that I believe will work for this.

I will be testing your script tomorrow. 

tom

-- Tom McGrath III
http://lazyriver.on-rev.com
mcgrath3 at mac.com

On May 10, 2013, at 4:23 PM, Geoff Canyon <gcanyon at gmail.com> wrote:

> Hi Scott,
> 
> I tried to simplify this and make it so that each control is adjusted in
> one step. This also optionally take different scaling factors for
> horizontal and vertical. Let me know if I missed anything. I'm not sure
> what everyone was seeing with resizing the group affecting the objects in
> it -- I'm not seeing that as far as I can tell.
> 
> All the implementations shown so far are losing fidelity due to rounding.
> If anyone is going to repeatedly resize groups/objects like this, it would
> make sense to store the original rects as a separate property, and always
> start from there. If the resizing needs to be cumulative, then I'd store
> the cumulative resizing factor as a property of the group, then when
> resizing multiply that by the new/additional factor before applying that to
> the stored rects to set the sizes.
> 
> Once we have open language, I'm so looking forward to being able to say
> something like:
> 
>    set the rect of every control of G to
> integerRect(shiftRect(scaleRect(shiftRect((the rect of it),-L,-T),H,V),L,T))
> 
> gc
> 
> 
> command scaleGroup G,H,V
>   if V is empty then put H into V
>   put the left of G into L
>   put the top of G into T
>   put shiftRect(scaleRect(shiftRect((the rect of G),-L,-T),H,V),L,T) into R
>   repeat with N = 1 to number of controls of G
>      set the rect of control N of G to
> integerRect(shiftRect(scaleRect(shiftRect((the rect of control N of
> G),-L,-T),H,V),L,T))
>   end repeat
>   set the margins of G to scaleRect((the margins of G),H,V)
>   set the rect of G to R
> end scaleGroup
> 
> function scaleRect R,H,V
>   if V is empty then put H into V
>   return (H * item 1 of R),(V * item 2 of R),(H * item 3 of R),(V * item 4
> of R)
> end scaleRect
> 
> function shiftRect R,H,V
>   if V is empty then put H into V
>   return (H + item 1 of R),(V + item 2 of R),(H + item 3 of R),(V + item 4
> of R)
> end shiftRect
> 
> function integerRect R
>   return round(item 1 of R),round(item 2 of R),round(item 3 of
> R),round(item 4 of R)
> end integerRect
> 
> 
> On Fri, May 10, 2013 at 7:00 AM, Thomas McGrath III <mcgrath3 at mac.com>wrote:
> 
>> Monte,
>> 
>> I won't be attending this year but I will be on the simulcast so I'll sort
>> of be there in spirit at the conference…..
>> 
>> Tom
>> 
>> -- Tom McGrath III
>> http://lazyriver.on-rev.com
>> mcgrath3 at mac.com
>> 
>> On May 10, 2013, at 1:15 AM, Monte Goulding <monte at sweattechnologies.com>
>> wrote:
>> 
>>> I asked this exact question on StackOverflow a couple of weeks ago and
>> before I was attacked by Mark for not asking the question he answered we
>> were getting somewhere... I did create solution that works by retaining an
>> offset for the child objects to use in their resizing.
>>> 
>>> 
>> http://stackoverflow.com/questions/16168091/how-do-you-change-the-rect-of-a-group-without-changing-the-location-of-the-objec/16178454#16178454
>>> 
>>> Anyway... all will be revealed at the conference on Tuesday
>>> 
>>> On 10/05/2013, at 5:23 AM, Thomas McGrath III <mcgrath3 at mac.com> wrote:
>>> 
>>>> Is there a way to resize and move a scrolling group without touching
>> the inside contents of that group??? This is on mobile and I need to resize
>> a scrolling group based on the position of the UI (navbar and toolbar when
>> in portrait and landscape) when the UI changes and then after the scrolling
>> group is right I then need to separately resize the contents for retina if
>> needed -- to double their height, width and topleft -- or regular.
>>>> 
>>>> If I resize the group first then it moves the content and then doubling
>> the content makes it the right size but positioned wrong.
>>>> If I resize the content and then move the group then it again correctly
>> sizes the contents but positions them wrong.
>>>> 
>>>> If the group moves then everything is in a different position from when
>> I laid them out in the desktop so they are off.
>>>> 
>>>> I want the scrolling group code to be separate from the resizing code
>> if possible.
>>>> 
>>>> 
>>>> Thanks,
>>>> 
>>>> Tom
>>>> 
>>>> -- Tom McGrath III
>>>> http://lazyriver.on-rev.com
>>>> mcgrath3 at mac.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
>>> 
>>> --
>>> Monte Goulding
>>> 
>>> M E R Goulding - software development services
>>> mergExt - There's an external for that!
>>> 
>>> 
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> 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
>> 
>> 
>> _______________________________________________
>> 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
>> 
> _______________________________________________
> 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