Outdooractive / route-me

Open source map library for iOS
Other
122 stars 400 forks source link

better fix for RMCircle path changes & artifacts #69

Closed incanus closed 12 years ago

incanus commented 12 years ago

This is an improvement on the #65 RMCircle patch from before.

The previous solution of swapping out the CAShapeLayer solves the problem of sizing up or down without clipping artifacts, but behaves weirdly when the map view is zoomed in or out.

Before: http://dl.dropbox.com/u/575564/path_before.mov

This patch instead reverts the CAShapeLayer swap and instead explicitly adds an animation to changes to the path properly of it. Per the class docs:

Unlike most animatable properties, path (as with all CGPathRef animatable properties) does not support implicit animation.

So this adds the animation if we exist inside of a CATransaction block with duration, matching its duration, for cases where we are animating zoom.

After: http://dl.dropbox.com/u/575564/path_after.mov