Pinch and Rotate

Ken Corey ken at kencorey.com
Wed Jan 25 11:19:03 EST 2012


On 25/01/2012 15:54, Thomas McGrath III wrote:
> These are exactly the kinds of things I ran into as well. One thing that happens is that when rotating an image the image gets distorted and so we need the resizeQuality set to "good" or "best" but then it really slows down even further.

Well, turns out I was a bit of a muppet about a few things...

I'm still rather hazy about the 'lock' button.  Apparently that needed 
to be checked, locking the image, and then the rotation is free.  So the 
code "works" as is for images, presuming that you uncheck the tick box.

As for the quality issues, what I'd suggest is that on the pinchStart 
event the quality of the image is saved during the pinch, the quality of 
the image is set to 'reduced' while pinching, and then in the pinchEnd 
the quality is set back to its previous value.  That should keep the 
speed acceptable.

As regarding rotation of a poly, there's a fun little function called 
'revRotatePoly' that gives one an idea of what to do...but of course the 
coordinates of the graphic are truncated after the calculation. Do this 
more than a time or two, and the accumulated errors gang up on you. I'm 
playing with some code that does this "properly", where the coordinates 
are stored into custom properties first, and *those* are used in the 
rotation calculation.  It's not nearly ready to be shown yet, but I'll 
try to tie up the loose ends in the next day or two.

None of this helps with the jitter, though.  This could be caused by 
re-entry into the touchMove handler, though I thought I'd guarded 
against that.

It's still creaky, but it's almost looking usable.

-Ken




More information about the use-livecode mailing list