Skip to content

Commit

Permalink
Merge pull request facebookarchive#44 from RuiAAPeres/master
Browse files Browse the repository at this point in the history
Added strokeColor Property & fixed a small typo
  • Loading branch information
Kimon Tsinteris committed May 2, 2014
2 parents 3be2d77 + 8a12d5e commit 9d2b04c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions pop-tests/POPAnimatablePropertyTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ - (void)testProvidedExistence
kPOPLayerRotationX,
kPOPShapeLayerStrokeStart,
kPOPShapeLayerStrokeEnd,
kPOPShapeLayerStrokeColor,
#if TARGET_OS_IPHONE
kPOPViewAlpha,
kPOPViewBackgroundColor,
Expand Down
1 change: 1 addition & 0 deletions pop/POPAnimatableProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ extern NSString * const kPOPLayerZPosition;
*/
extern NSString * const kPOPShapeLayerStrokeStart;
extern NSString * const kPOPShapeLayerStrokeEnd;
extern NSString * const kPOPShapeLayerStrokeColor;

/**
Common NSLayoutConstraint property names.
Expand Down
15 changes: 14 additions & 1 deletion pop/POPAnimatableProperty.mm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
NSString * const kPOPLayerZPosition = @"zPosition";

NSString * const kPOPShapeLayerStrokeStart = @"shapeLayer.strokeStart";
NSString * const kPOPShapeLayerStrokeEnd = @"shaperLayer.strokeEnd";
NSString * const kPOPShapeLayerStrokeEnd = @"shapeLayer.strokeEnd";
NSString * const kPOPShapeLayerStrokeColor = @"shapeLayer.strokeColor";

NSString * const kPOPLayoutConstraintConstant = @"layoutConstraint.constant";

Expand Down Expand Up @@ -348,6 +349,18 @@
},
0.01
},

{kPOPShapeLayerStrokeColor,
^(CAShapeLayer *obj, CGFloat values[]) {
POPCGColorGetRGBAComponents(obj.strokeColor, values);
},
^(CAShapeLayer *obj, const CGFloat values[]) {
CGColorRef color = POPCGColorRGBACreate(values);
[obj setStrokeColor:color];
CGColorRelease(color);
},
0.01
},

{kPOPLayoutConstraintConstant,
^(NSLayoutConstraint *obj, CGFloat values[]) {
Expand Down

0 comments on commit 9d2b04c

Please sign in to comment.