Reputation:
I have an UIView that represents a circle. When the user is performing the zoom gesture, i want to resize the circle, but maintain the same center of it, only resize the width and height of it. If the zoom scale is large, the user will only see the circle when he zooms in that area, so i want to resize it accordingly so that the other elements in view still be visible and the circle ratio to maintain the same even though the zoom scale is 1 or 10.
Upvotes: 1
Views: 160
Reputation: 119031
The easiest way to do that is to take the current frame
and use the zoom factor (delta since the last change) with CGRectInset
. It will create a larger or smaller version of the frame
without changing the centre point.
Upvotes: 1