-
Notifications
You must be signed in to change notification settings - Fork 806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Affine Transform in CGPath #1550
Changes from 1 commit
e6d72aa
955c0af
0c09d87
697fb5b
0e52a5f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -754,21 +754,34 @@ CGPathRef CGPathCreateCopyByStrokingPath( | |
} | ||
|
||
/** | ||
@Status Stub | ||
@Notes | ||
@Status Caveat | ||
@Notes Creates a mutable copy | ||
*/ | ||
CGPathRef CGPathCreateCopyByTransformingPath(CGPathRef path, const CGAffineTransform* transform) { | ||
UNIMPLEMENTED(); | ||
return StubReturn(); | ||
return CGPathCreateMutableCopyByTransformingPath(path, transform); | ||
} | ||
|
||
/** | ||
@Status Stub | ||
@Notes | ||
@Status Interoperable | ||
*/ | ||
CGMutablePathRef CGPathCreateMutableCopyByTransformingPath(CGPathRef path, const CGAffineTransform* transform) { | ||
UNIMPLEMENTED(); | ||
return StubReturn(); | ||
RETURN_NULL_IF(!path); | ||
|
||
if (transform) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: fold these together? |
||
if (CGAffineTransformEqualToTransform(*transform, CGAffineTransformIdentity)) { | ||
return CGPathCreateMutableCopy(path); | ||
} | ||
|
||
CGMutablePathRef transformedPath = CGPathCreateMutable(); | ||
path->ClosePath(); | ||
|
||
FAIL_FAST_IF_FAILED(transformedPath->AddGeometryToPathWithTransformation(path->GetPathGeometry().Get(), transform)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It bothers me a bit that GetPathGeometry returns a |
||
transformedPath->SetCurrentPoint(CGPointApplyAffineTransform(path->GetCurrentPoint(), *transform)); | ||
transformedPath->SetStartingPoint(CGPointApplyAffineTransform(path->GetStartingPoint(), *transform)); | ||
transformedPath->SetLastTransform(transform); | ||
return transformedPath; | ||
} | ||
return CGPathCreateMutableCopy(path); | ||
} | ||
|
||
/** | ||
|
@@ -782,7 +795,7 @@ CGPathRef CGPathCreateWithRoundedRect(CGRect rect, CGFloat cornerWidth, CGFloat | |
} | ||
|
||
/** | ||
@Status Stub | ||
@Status Interoperable | ||
*/ | ||
bool CGPathEqualToPath(CGPathRef path1, CGPathRef path2) { | ||
return __CGPathEqual(path1, path2); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be interoperable. It would be a caveat if ref plat created mutable copy and we didn't. #Resolved