Rotation issue

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
Happyrever
Posts: 55
Joined: Sat Sep 10, 2011 12:22 pm

Rotation issue

Post by Happyrever » Fri Nov 11, 2011 11:04 am

Does anyone have a code snippet that maintains the 90 degree corners of a rectangle (image) when rotated by a known angle.
For example, an image rotated by 45degrees becomes diamond shaped with no corners at 90degrees.
Thank you in anticipation.

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Rotation issue

Post by Klaus » Fri Nov 11, 2011 11:42 am

Hi Happyrever,

sorry, I have no idea what you are talking about :D
When I "set the angle of img X to 45", I get an image that is rotated by 45 degrees, nothing more and nothing less!?

Could you post a screenshot to visualize your problem?


Best

Klaus

Happyrever
Posts: 55
Joined: Sat Sep 10, 2011 12:22 pm

Re: Rotation issue

Post by Happyrever » Fri Nov 11, 2011 1:10 pm

The distortion I experienced is documented in the dictionary, however I see the correct way is to set the angle property rather than rotate.

It now introduces the issue of how to fit the overall taller and wider shape within the original rectangle size. Do you have an answer for that?

I have used your handy routine to maintain the rectangle proportions when an image is put into a given rectangular space, but of course, it was not intended for a partially rotated image.

Happyrever
Posts: 55
Joined: Sat Sep 10, 2011 12:22 pm

Re: Rotation issue

Post by Happyrever » Fri Nov 11, 2011 1:16 pm

Sorry, problem solved by using the LockLocation to true so the rotated image fits the original rectangle.
Thanks for your time, it did promote thought.

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Rotation issue

Post by Klaus » Fri Nov 11, 2011 1:22 pm

Hi Happyrever,

ah, I see, sorry for my misunderstanding.

Yep, the "rotate" command is more an "image editing" feature, and setting the angle is for "display" purposes.
But since they completely "revamped" the graphics engine, "angled" images could definitively look better in my opinion! 8)


Best

Klaus

Post Reply