Is it possible to query the current point from a CGContext?

Apple Quartz2d Programming Guide states: "Quartz tracks the current point , which is the last place used to build the path. "Is there any way for me to ask what is the current point, given the CGContext link?

I write methods by drawing a diagram in segments, and it seems that if CGContext already knows what the current point is, I don’t need to write the logic needed to track it separately. It seems silly to pass both the CGContext and the current coordinates of the points in method calls.

+5
source share
1 answer

This is how I get the current point:

CGPoint currentPoint = CGContextGetPathCurrentPoint(context);
NSLog(@"currentPoint: %@", NSStringFromCGPoint(currentPoint));
+7
source

All Articles