Skip to content

Commit

Permalink
fixed blurry view edge stretching
Browse files Browse the repository at this point in the history
  • Loading branch information
zapsleep committed Jan 21, 2013
1 parent c3d69f2 commit 69673ba
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions BlurTest/DVSelectiveTestViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,17 @@ -(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrien
-(void)timerAction {
static NSInteger xDirection = 4;
static NSInteger yDirection = 4;
static UIView *movingView;

movingView = self.blurryAreaView;
self.blurryAreaView.center = CGPointMake(self.blurryAreaView.center.x + xDirection,
self.blurryAreaView.center.y + yDirection);

movingView.center = CGPointMake(movingView.center.x + xDirection,
movingView.center.y + yDirection);
if (movingView.center.x < 0 || movingView.center.x > self.backingImageView.bounds.size.width) {
CGFloat rightSide = self.blurryAreaView.frame.origin.x + self.blurryAreaView.frame.size.width;
if (self.blurryAreaView.frame.origin.x <= 0 || rightSide >= self.backingImageView.bounds.size.width) {
xDirection *= -1;
}
if (movingView.center.y < 0 || movingView.center.y > self.backingImageView.bounds.size.height) {

CGFloat bottomSide = self.blurryAreaView.frame.origin.y + self.blurryAreaView.frame.size.height;
if (self.blurryAreaView.frame.origin.y <= 0 || bottomSide >= self.backingImageView.bounds.size.height) {
yDirection *= -1;
}

Expand Down

0 comments on commit 69673ba

Please sign in to comment.