I am trying to draw a circle (small like a dot) at the exact point of a UITouch.
The problem is, when I get the touchPoint from the user touch, I have to then draw the Rect in which to place the circle.
To work out an origin for the Rect, to place it such that, a circle drawn within it will have a centre point at the original touchpoint, I have used Pythagorus’ theorem.
However, this approach is not elegant and is not exact.
Is there a better way to do this?
UITouch *touch = obj;
CGPoint touchPoint = [touch locationInView:self.view];
CGContextAddEllipseInRect(context,(CGRectMake ((touchPoint.x - 5.7), (touchPoint.y - 5.7)
, 9.0, 9.0)));
you can do like below