Can one manually resize an object proportionately?

Malte Brill revolution at derbrill.de
Sun Apr 10 14:46:46 EDT 2005


Hi Steve,

ok. I thought about it for a while and scripted a little quirky 
version. It works relatively good. Hold down the commandKey while 
resizing.

Hope it helps.

With libRMC in use try this in your stacks script (mind linewraps!):

on moveControl
   set the isLeftObj of this cd to the left of the selectedObject
   set the isTopObj of this cd to the top of the selectedObject
   set the isrightObj of this cd to the right of the selectedObject
   set the isbottomObj of this cd to the bottom of the selectedObject
end moveControl


on selectedObjectChanged
   if the selectedObject is empty then pass selectedObjectChanged
   put the selectedObject
   set the isLeftObj of this cd to the left of the selectedObject
   set the isTopObj of this cd to the top of the selectedObject
   set the isrightObj of this cd to the right of the selectedObject
   set the isbottomObj of this cd to the bottom of the selectedObject
end selectedObjectChanged

on resizeControl
   if the commandKey is down then
     if the mouseH>the isLeftObj of this cd then
       put the isLeftObj of this cd into x1
       put the mouseH into x2
       set the leftFlag of this cd to true
     else
       put the isrightObj of this cd into x2
       put the mouseH into x1
       set the leftFlag of this cd to false
     end if
     if the mouseV>the isTopObj of this cd then
       put the isTopObj of this cd into y1
       put the mouseH into y2
       set the topFlag of this cd to true
     else
       put the isbottomObj of this cd into y2
       put the mouseH into y1
       set the topFlag of this cd to false
     end if
     if libRMC is not in the stacksInUse then
       answer "You must start using libRMC for this handler to work"
     end if
     set the aspectScale of the selectedObject to x1,y1,x2,y2,false
     if the topFlag of this cd then
       set the top of the selectedObject to the isTopObj of this cd
     else
       set the bottom of the selectedObject to the istopObj of this cd
     end if
     if the leftFlag of this cd then
       set the left of the selectedObject to the isLeftObj of this cd
     else
       set the right of the selectedObject to the isleftObj of this cd
     end if
     set the isLeftObj of this cd to the left of the selectedObject
     set the isTopObj of this cd to the top of the selectedObject
     set the isrightObj of this cd to the right of the selectedObject
     set the isbottomObj of this cd to the bottom of the selectedObject
   else
     set the isLeftObj of this cd to the left of the selectedObject
     set the isTopObj of this cd to the top of the selectedObject
     set the isrightObj of this cd to the right of the selectedObject
     set the isbottomObj of this cd to the bottom of the selectedObject
     pass resizeControl
   end if
end resizeControl


@Marty:

Holding down the shiftkey resizes a control in a quadratic ratio. I 
like it as a feature even though I agree it should be the other way. 
Maybe you should enter a request into Bugzilla.

Cheers,

Malte



More information about the use-livecode mailing list