Skip to content

Commit

Permalink
Center swipe gestures
Browse files Browse the repository at this point in the history
  • Loading branch information
andygeers committed Feb 25, 2015
1 parent 3673f02 commit 1531e0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Coach Marks/DDCircleView.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ - (void)userTap:(UITapGestureRecognizer *)recognizer {

- (void)swipeInFrame:(CGRect)frame
{
[self centerYPositioninView:self inFrame:frame];
[self centerInView:self inFrame:frame];
[self animateSwipe];
}

Expand Down Expand Up @@ -101,7 +101,7 @@ - (void)centerYPositioninView:(UIView *)view inFrame:(CGRect)frame
- (void)centerXPositioninView:(UIView *)view inFrame:(CGRect)frame
{
CGFloat centerX = frame.origin.x + CGRectGetWidth(frame)/2;
CGFloat offsetX = CGRectGetWidth(view.frame)/2;
CGFloat offsetX = 260/2;

CGFloat newX = centerX - offsetX;
view.frame = CGRectMake(newX, view.frame.origin.y, 40, 40);
Expand Down
2 changes: 1 addition & 1 deletion Coach Marks/DDCoachMarksView.m
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ - (void)showSwipeGesture

// create an animating circle and animate it
if (shouldAnimateSwipe) {
self.animatingCircle = [[DDCircleView alloc] initWithFrame:CGRectZero];
self.animatingCircle = [[DDCircleView alloc] initWithFrame:self.frame];

if (![self.subviews containsObject:self.animatingCircle]) {
[self addSubview:self.animatingCircle];
Expand Down

0 comments on commit 1531e0d

Please sign in to comment.