-
Notifications
You must be signed in to change notification settings - Fork 808
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
Improve CAShapeLayer #2134
Improve CAShapeLayer #2134
Conversation
@@ -34,8 +34,8 @@ CA_EXPORT_CLASS | |||
|
|||
@property CGPathRef path; | |||
@property CGColorRef fillColor; | |||
@property (copy) NSString* fillRule STUB_PROPERTY; | |||
@property (copy) NSString* lineCap STUB_PROPERTY; | |||
@property (copy) NSString* fillRule; |
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.
Does woccatalog have tests for fillRule and lineCap?
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.
How does (copy) work w/ overriding default getter/setter?
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.
It doesn't; however, there's no the object you pass in will be ignored completely, as objects go
annotation; assign would be truer, but copy is what the reference platform specifies and it is expected for all strings.
Since we've implemented it in terms of an enumerated value, we hold true to one of the core tenets of copy
: The string they pass into the setter and the string they get back from the getter may not be the same pointer ;)
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.
To clarify question above - lets add the variation to woccatalog test to demonstrate this works.
@implementation CAShapeLayer { | ||
CGPathRef _path; | ||
CGPathDrawingMode _fillMode; | ||
CGLineCap _lineCap; | ||
float _lineWidth; |
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.
nit: CGFloat
@@ -34,8 +34,8 @@ CA_EXPORT_CLASS | |||
|
|||
@property CGPathRef path; | |||
@property CGColorRef fillColor; | |||
@property (copy) NSString* fillRule STUB_PROPERTY; | |||
@property (copy) NSString* lineCap STUB_PROPERTY; | |||
@property (copy) NSString* fillRule; |
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.
How does (copy) work w/ overriding default getter/setter?
|
||
if (_path == nil) { | ||
_shapeImage.contents = nil; | ||
- (void)drawInContext:(CGContextRef)context { |
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.
nit: return if invalid context?
@rajsesh-msft ping! 😄 I'd like to make sure I address your concerns |
This pull request fixes CAShapeLayer the issues mentioned in #2039, plus adds support for EO fill and line caps.
CAShapeLayer originally used a nested layer that it manually poked an image into; doing this is incompatible with #1194 (and therefore #2119). It also had a secret dependency on
CreateLayerContentsBitmapContext32
, a private import from CALayer.Testing was carried out manually in WOCCatalog on 1.0, 2.0, and 3.5-scale devices.
Fixes #2039.