Can one manually resize an object proportionately?

Howard Bornstein howard.bornstein at gmail.com
Sun Apr 10 15:09:59 EDT 2005


On Apr 10, 2005 7:58 AM, Stgoldberg at aol.com <Stgoldberg at aol.com> wrote:
> Thanks, Malte for your suggestions.   However, in this case what I am
> suggesting is that rather than having to type in numbers to resize an
> object proportionately, there needs to be some way to do this manually, such
> as holding down the Shift key while doing the resizing (like in Photoshop), which I
> don't see is a feature of Revolution.   

Here's a quick and dirty way to do what you want. I'm sure someone can
come up with a more elegant method.

In your stack script put this handler:

on mousemove
  global gRatio,gObject
  if the optionkey is down then
    put empty into gRatio
  end if
  if there is a selectedobject then
    if the selectedobject <> gObject then
      put empty into gRatio
    end if
    put the selectedobject into gObject
    put the width of gObject into tWidth
    put the height of gObject into tHeight

    if gRatio is empty then
      put tWidth/tHeight into gRatio
    end if

    if the commandkey is down then
      set the width of gObject to (the height of gObject * gRatio)
    end if
  end if
  pass mousemove
end mousemove

You hold down the commandkey to resize proportionally given the
exisiting proportions. If you want to change the proportions, then
hold down the option key while you change them. Then use the
command-key to resize proportionally to the new proportions (is this
getting confusing)?

Of course, you have to use the selection tool, not the browse tool.

Unfortunately, holding the shift key forces the sides of the object to
always be equal. The mousemove handler can't override this. :-(

-- 
Regards,

Howard Bornstein
-----------------------
www.designeq.com


More information about the use-livecode mailing list