Re: Moving a UIView when has a CAAffineTransformationRotate
Re: Moving a UIView when has a CAAffineTransformationRotate
- Subject: Re: Moving a UIView when has a CAAffineTransformationRotate
- From: Gustavo Pizano <email@hidden>
- Date: Tue, 30 Nov 2010 19:41:01 +0100
Hello Duncan.
I did this change and it worked, i dunno if tis correct to do it, but the thing is I need the new locations respective the superview, not the view itself, so I have this:
UITouch *aTouch = [touches anyObject];
CGPoint loc = [aTouch locationInView:bc_parentScene];
CGPoint prevloc = [aTouch previousLocationInView:bc_parentScene];
CGPoint center = self.center;
float deltaX = loc.x - prevloc.x;
float deltaY = loc.y - prevloc.y;
center.x += deltaX;
center.y += deltaY;
[self setCenter:center];
bc_parentscene is the superview.superview so I have a weak reference to it since creation, + for another functionality i need . . .
Gustavo
On Nov 30, 2010, at 7:11 PM, David Duncan wrote:
> On Nov 30, 2010, at 9:49 AM, Gustavo Pizano wrote:
>
>> Any help or tip may be appreciate, my linear algebra is not that good ... :SS I wanna cry...
>
>
> Move the center instead of the frame. The frame is derived from the center, bounds.size and transform, so once you've placed a transform on the view the frame is a much less reliable means of making adjustments to the view.
> --
> David Duncan
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden