Syncing CATiledLayer drawInContext: with setAffineTransform:
Syncing CATiledLayer drawInContext: with setAffineTransform:
- Subject: Syncing CATiledLayer drawInContext: with setAffineTransform:
- From: Dave Fernandes <email@hidden>
- Date: Fri, 01 Mar 2013 17:43:43 -0500
I'm using a CATiledLayer to plot a stream of data points in real-time on iOS 6. When the user pinches to zoom in either X or Y, I need to zoom the plot. To avoid lots of flashing during redraws, I use an affine transform *during* the zoom gesture, but then redraw the plot after the gesture is complete.
This works, but there is an instant where I need to transition from the zoomed-by-transform plot to the zoomed-by-redrawing plot. Where is the appropriate place to reset the transform to the identity transform? Doing it in drawInContext: seems to work most but not all of the time (sometimes it flashes or fails to redraw correctly - presumably a race condition). Ditto for a dispatch_async to the main queue.
Note: all drawing in drawInContext is done using CGContextXXX methods.
I am going about this the wrong way?
Thanks,
Dave
_______________________________________________
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