Resizing a group to clip an object symetrically

Terry Judd terry.judd at unimelb.edu.au
Thu Dec 12 19:14:13 EST 2013


Thanks Scott - as with John's solution I hadn't twigged that I needed to set the loc of the graphic after  resizing the group.

Cheers,

Terry...

On 13/12/2013, at 10:53 AM, Scott Rossi wrote:

> Hi Terry:
> 
> This works if the group is locked and requires grabbing the loc of the
> oval.
> 
> command cropGraphic pPercent
>   put height of grc "oval" div 2 into H
>   put loc of grc "oval" into theLoc
>   put item 2 of theLoc into Y
>   put rect of grp 1 into theRect
>   put Y - (pPercent/100)*H into item 2 of theRect
>   put Y + (pPercent/100)*H into item 4 of theRect
>   set rect of grp 1 to theRect
>   set loc of grc 1 to theLoc
> end cropGraphic
> 
> 
> Regards,
> 
> Scott Rossi
> Creative Director
> Tactile Media, UX/UI Design
> 
> 
> 
> 
> On 12/12/13 2:52 PM, "Terry Judd" <terry.judd at unimelb.edu.au> wrote:
> 
>> I have a group that contains a single round graphic object. The group is
>> narrower than the graphic so that only a segment of the disc is
>> displayed. I now want to animate a reduction in the height of the group
>> so that the disc is clipped symetrically at the top and the bottom.
>> Setting the height or the rect of the group doesn't seem to work as the
>> group only gets resized from the bottom. What am I missing?
>> 
>> Terry...
>> 
>> Dr Terry Judd
>> Senior Lecturer in Medical Education
>> Medical Education Unit
>> Faculty of Medicine, Dentistry & Health Sciences
>> The University of Melbourne
>> 
>> 
>> 
>> 
>> _______________________________________________
>> 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
> 

Dr Terry Judd
Senior Lecturer in Medical Education
Medical Education Unit
Faculty of Medicine, Dentistry & Health Sciences
The University of Melbourne









More information about the Use-livecode mailing list