Posts

Post marked as unsolved
316 Views

CGPathMoveToPoint not working as in iOS 11(bug?)

It seems CGPathMoveToPoint no longer works as in iOS 11 and it breaks a few things for me.Is this a bug?Take the folowing code: CGMutablePathRef path = CGPathCreateMutable(); CGPathMoveToPoint(path, NULL, 0, 0); CGPathMoveToPoint(path, NULL, 10, 10); CGPathAddLineToPoint(path, NULL, 20, 20); CGRect rect = CGPathGetBoundingBox(path);In iOS 11:Printing description of path:Path 0x60c000036140: moveto (10, 10) lineto (20, 20)Printing description of rect:(CGRect) rect = (origin = (x = 10, y = 10), size = (width = 10, height = 10))In iOS 12:Printing description of path:Path 0x6000031adb90: moveto (0, 0) moveto (10, 10) lineto (20, 20)Printing description of rect:(CGRect) rect = (origin = (x = 0, y = 0), size = (width = 20, height = 20))There seem to be 2 issues here1/ As you can see succesive moveTo commands are no longer compressed into one, which seems quite inefficient(you could argue that it inefficient to call moveTo twice but still...).2/ The bounding box seems to include the first moveTo which does not actually produce any graphic output.Regards,Cristian
Asked
Last updated .