diff --git a/Classes/BITBlurImageAnnotation.m b/Classes/BITBlurImageAnnotation.m index 898ce2a3c8..9d8f762cd2 100644 --- a/Classes/BITBlurImageAnnotation.m +++ b/Classes/BITBlurImageAnnotation.m @@ -35,23 +35,30 @@ UIGraphicsBeginImageContext(size); [sourceImage drawInRect:CGRectMake(0, 0, size.width, size.height)]; self.scaledImage = UIGraphicsGetImageFromCurrentImageContext(); + self.imageLayer.shouldRasterize = YES; + self.imageLayer.rasterizationScale = 1; + self.imageLayer.magnificationFilter = kCAFilterNearest; self.imageLayer.contents = (id)self.scaledImage.CGImage; + + + UIGraphicsEndImageContext(); } - (void)layoutSubviews { [super layoutSubviews]; + + [CATransaction begin]; + [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; + self.imageLayer.frame = self.imageFrame; self.imageLayer.masksToBounds = YES; + + [CATransaction commit]; } -/* -// Only override drawRect: if you perform custom drawing. -// An empty implementation adversely affects performance during animation. -- (void)drawRect:(CGRect)rect -{ - // Drawing code +-(BOOL)resizable { + return YES; } -*/ @end diff --git a/Classes/BITImageAnnotationViewController.m b/Classes/BITImageAnnotationViewController.m index 2c412b9ecf..b8579cf64d 100644 --- a/Classes/BITImageAnnotationViewController.m +++ b/Classes/BITImageAnnotationViewController.m @@ -162,6 +162,8 @@ self.currentAnnotation.frame = CGRectMake(self.panStart.x, self.panStart.y, bla.x - self.panStart.x, bla.y - self.panStart.y); self.currentAnnotation.movedDelta = CGSizeMake(bla.x - self.panStart.x, bla.y - self.panStart.y); self.currentAnnotation.imageFrame = [self.view convertRect:self.imageView.frame toView:self.currentAnnotation]; + [self.currentAnnotation setNeedsLayout]; + [self.currentAnnotation layoutIfNeeded]; } else { self.currentAnnotation = nil; self.isDrawing = NO; @@ -183,6 +185,8 @@ self.currentAnnotation.frame = annotationFrame; self.currentAnnotation.imageFrame = [self.view convertRect:self.imageView.frame toView:self.currentAnnotation]; + [self.currentAnnotation setNeedsLayout]; + [self.currentAnnotation layoutIfNeeded]; [gestureRecognizer setTranslation:CGPointZero inView:self.view];