Page 1 of 1
scaling an image only works when angle is near 0?
Posted: Mon Jan 23, 2012 3:19 pm
by kcorey
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?
Re: scaling an image only works when angle is near 0?
Posted: Mon Jan 23, 2012 7:07 pm
by mwieder
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.
Re: scaling an image only works when angle is near 0?
Posted: Mon Jan 23, 2012 8:49 pm
by sturgis
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?
Re: scaling an image only works when angle is near 0?
Posted: Tue Jan 24, 2012 12:09 am
by kcorey
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
Re: scaling an image only works when angle is near 0?
Posted: Tue Jan 24, 2012 1:12 am
by bn
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
Re: scaling an image only works when angle is near 0?
Posted: Fri Feb 03, 2012 11:39 am
by kcorey
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