Skip to content

Commit

Permalink
[BottomAppBar] Fix bottom app bar animation for leading and trailing …
Browse files Browse the repository at this point in the history
…states. (#2036)

* Fix bottom app bar animation

* Update file comments to correct year

* [BottomAppBar] Fix bottom app bar animation for leading and trailing states
  • Loading branch information
Junius Gunaratne authored Sep 25, 2017
1 parent e68fee2 commit e0ce854
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions components/BottomAppBar/src/private/MDCBottomAppBarLayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,15 @@ - (CGPathRef)pathWithoutCutFromRect:(CGRect)rect
- (UIBezierPath *)pathWithoutCutLeft:(UIBezierPath *)bottomBarPath
width:(CGFloat)width
height:(CGFloat)height {
CGFloat offsetRadiusDiff = kMDCBottomAppBarYOffset - kMDCBottomAppBarFloatingButtonRadius;
[bottomBarPath moveToPoint:CGPointMake(0, kMDCBottomAppBarYOffset)];
[bottomBarPath addLineToPoint:CGPointMake(kMDCBottomAppBarFloatingButtonPositionX -
kMDCBottomAppBarFloatingButtonRadius,
offsetRadiusDiff,
kMDCBottomAppBarYOffset)];
[bottomBarPath addLineToPoint:CGPointMake(kMDCBottomAppBarFloatingButtonPositionX,
kMDCBottomAppBarYOffset)];
[bottomBarPath addLineToPoint:CGPointMake(kMDCBottomAppBarFloatingButtonPositionX +
kMDCBottomAppBarFloatingButtonRadius,
offsetRadiusDiff,
kMDCBottomAppBarYOffset)];
[bottomBarPath addLineToPoint:CGPointMake(width, kMDCBottomAppBarYOffset)];
[bottomBarPath addLineToPoint:CGPointMake(width, height * 2 + kMDCBottomAppBarYOffset)];
Expand All @@ -235,14 +236,15 @@ - (UIBezierPath *)pathWithoutCutLeft:(UIBezierPath *)bottomBarPath
- (UIBezierPath *)pathWithoutCutRight:(UIBezierPath *)bottomBarPath
width:(CGFloat)width
height:(CGFloat)height {
CGFloat offsetRadiusDiff = kMDCBottomAppBarYOffset - kMDCBottomAppBarFloatingButtonRadius;
[bottomBarPath moveToPoint:CGPointMake(0, kMDCBottomAppBarYOffset)];
[bottomBarPath addLineToPoint:CGPointMake(width - kMDCBottomAppBarFloatingButtonPositionX -
kMDCBottomAppBarFloatingButtonRadius,
offsetRadiusDiff,
kMDCBottomAppBarYOffset)];
[bottomBarPath addLineToPoint:CGPointMake(width - kMDCBottomAppBarFloatingButtonPositionX,
kMDCBottomAppBarYOffset)];
[bottomBarPath addLineToPoint:CGPointMake(width - kMDCBottomAppBarFloatingButtonPositionX +
kMDCBottomAppBarFloatingButtonRadius,
offsetRadiusDiff,
kMDCBottomAppBarYOffset)];
[bottomBarPath addLineToPoint:CGPointMake(width, kMDCBottomAppBarYOffset)];
[bottomBarPath addLineToPoint:CGPointMake(width, height * 2 + kMDCBottomAppBarYOffset)];
Expand Down

0 comments on commit e0ce854

Please sign in to comment.