scaling an image only works when angle is near 0?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
kcorey
Posts: 62
Joined: Fri Nov 25, 2011 6:06 pm

scaling an image only works when angle is near 0?

Post by kcorey » Mon Jan 23, 2012 3:19 pm

Hi All,

I was having a look at multi-touch, and ran across something strange:

Setting the width and height of an image only seems to have an effect when the angle of the image is 0.

Can that be right? I can image a *very* long way around this by cloning the image, scaling the new image, and then rotating that, but that seems extravagantly wasteful.

-Ken

P.S. Just for fun, I tried a graphic out there, and changing the angle property has no effect at all. Wasn't the angle property originally /only/ for graphics? And now that's been removed?

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: scaling an image only works when angle is near 0?

Post by mwieder » Mon Jan 23, 2012 7:07 pm

P.S. Just for fun, I tried a graphic out there, and changing the angle property has no effect at all. Wasn't the angle property originally /only/ for graphics? And now that's been removed?
Ken-

One of the weirder parts of the language. Check out the "rotate" command for images instead of setting the angle.

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: scaling an image only works when angle is near 0?

Post by sturgis » Mon Jan 23, 2012 8:49 pm

For rotating graphics look at revrotatepoly. It works nicely though there are a couple quirks. If you rotate the poly repeatedly, due to the necessity to truncate the pointlist for the grc (you can't have a point at 1.235,35.434 pixels) this can cause the poly to eventually rotate itself down smaller and smaller. While its probably not the BEST way, I got around this by simply storing the initial point list then on each iteration reset the grc points list back to the start setting and rotate from there.

There is probably something here i'm missing of course that would make it easier, but as it is its pretty workable.
kcorey wrote:
P.S. Just for fun, I tried a graphic out there, and changing the angle property has no effect at all. Wasn't the angle property originally /only/ for graphics? And now that's been removed?

kcorey
Posts: 62
Joined: Fri Nov 25, 2011 6:06 pm

Re: scaling an image only works when angle is near 0?

Post by kcorey » Tue Jan 24, 2012 12:09 am

Ah, that works for lines, curves, or irregular polygons. What about rect? rounded rect?, oval?

I think the thing I find most frustrating with runrev is the sheer chaotic nature of the interfaces.

-Ken

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4015
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: scaling an image only works when angle is near 0?

Post by bn » Tue Jan 24, 2012 1:12 am

Hi Ken,

here is an example of scaling and turning an image at the same time. It is not rotate/enlarge multitouch iOS but might give you some ideas.

http://forums.runrev.com/phpBB2/viewtop ... 042#p37952

see the thread for context.

Kind regards

Bernd

kcorey
Posts: 62
Joined: Fri Nov 25, 2011 6:06 pm

Re: scaling an image only works when angle is near 0?

Post by kcorey » Fri Feb 03, 2012 11:39 am

The thing causing the trouble was the 'lock size & position' checkbox.

If this is not checked, then sizing only happens when the angle is 0.

If this is checked, then sizing and rotation can happen at the same time.

Seems backwards, but there it is.

-Ken

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”