Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion DashWallet/DWPhoneWCSessionManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,13 @@ - (UIImage *)qrCode
}

if (! image && req) {
image = [UIImage dw_imageWithQRCodeData:req color:[CIColor colorWithRed:0.0 green:0.0 blue:0.0]];
image = [UIImage dw_imageWithQRCodeData:req color:[CIColor colorWithRed:0.0 green:141.0/255.0 blue:228.0/255.0]];
}

UIImage *resizedImage = [image dw_resize:CGSizeMake(150, 150) withInterpolationQuality:kCGInterpolationNone];
UIImage *overlayLogo = [[UIImage imageNamed:@"dashQROverlay"] dw_resize:CGSizeMake(37.0, 37.0) withInterpolationQuality:kCGInterpolationMedium];
CGSize holeSize = CGSizeMake(40.0, 40.0);
resizedImage = [resizedImage dw_imageByCuttingHoleInCenterWithSize:holeSize];
UIImage *result = [resizedImage dw_imageByMergingWithImage:overlayLogo];

return result;
Expand Down
5 changes: 3 additions & 2 deletions DashWallet/DWReceiveViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,13 @@ - (void)updateAddress

if (! image && req.data) {
image = [UIImage dw_imageWithQRCodeData:req.data color:[CIColor colorWithRed:0.0 green:141.0/255.0 blue:228.0/255.0]];
CGSize holeSize = CGSizeMake(5.0, 5.0);
image = [image dw_imageByCuttingHoleInCenterWithSize:holeSize];
}

UIImage *overlayLogo = [UIImage imageNamed:@"dashQROverlay"];
UIImage *resizedImage = [image dw_resize:qrViewBounds withInterpolationQuality:kCGInterpolationNone];

CGSize holeSize = CGSizeMake(67.0, 67.0);
resizedImage = [resizedImage dw_imageByCuttingHoleInCenterWithSize:holeSize];

self.qrImage = [resizedImage dw_imageByMergingWithImage:overlayLogo];

Expand Down
13 changes: 3 additions & 10 deletions DashWallet/UIImage+Utils.m
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,11 @@ - (UIImage *)dw_imageByMergingWithImage:(UIImage *)secondImage secondImageRect:(

- (UIImage *)dw_imageByCuttingHoleInCenterWithSize:(CGSize)holeSize {
CGSize size = self.size;
CGPoint centerPoint = CGPointMake((size.width - holeSize.width) / 2.0, (size.height - holeSize.height) / 2.0);
CGFloat radius = ceil(holeSize.width / 2.0);
CGPoint centerPoint = CGPointMake(ceil(size.width / 2.0), ceil(size.height / 2.0));

UIBezierPath *currentPath = [UIBezierPath bezierPath];
CGPoint tempPoint = centerPoint;
[currentPath moveToPoint:CGPointMake(tempPoint.x, tempPoint.y)];

tempPoint = CGPointMake(centerPoint.x, centerPoint.y + holeSize.height);
[currentPath addLineToPoint:CGPointMake(tempPoint.x, tempPoint.y)];
tempPoint = CGPointMake(centerPoint.x + holeSize.width, centerPoint.y + holeSize.height);
[currentPath addLineToPoint:CGPointMake(tempPoint.x, tempPoint.y)];
tempPoint = CGPointMake(centerPoint.x + holeSize.width, centerPoint.y);
[currentPath addLineToPoint:CGPointMake(tempPoint.x, tempPoint.y)];
[currentPath addArcWithCenter:centerPoint radius:radius startAngle:0.0 endAngle:2.0 * M_PI clockwise:YES];
[currentPath closePath];

UIGraphicsBeginImageContext(size);
Expand Down
4 changes: 3 additions & 1 deletion TodayExtension/BRTodayViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ - (void)updateReceiveMoneyUI
NSData *imageData = [self.appGroupUserDefault objectForKey:APP_GROUP_QR_IMAGE_KEY];
UIImage *image = [UIImage imageWithData:imageData];
UIImage *resizedImage = [image dw_resize:CGSizeMake(240, 240) withInterpolationQuality:kCGInterpolationNone];
UIImage *overlayLogo = [UIImage imageNamed:@"dashQROverlay"];
UIImage *overlayLogo = [[UIImage imageNamed:@"dashQROverlay"] dw_resize:CGSizeMake(60.0, 60.0) withInterpolationQuality:kCGInterpolationMedium];
CGSize holeSize = CGSizeMake(64.0, 64.0);
resizedImage = [resizedImage dw_imageByCuttingHoleInCenterWithSize:holeSize];
UIImage *result = [resizedImage dw_imageByMergingWithImage:overlayLogo];

self.qrOverlay.image = result;
Expand Down