From 5a25feef477b80c9103fc792a805cb88735f0235 Mon Sep 17 00:00:00 2001 From: Can OMUR Date: Thu, 9 Jul 2015 12:41:47 +0200 Subject: [PATCH] drawSight rectangle bug Hi, I guess you commented the rectangle part of your code because it wasn't in the middle of the screen (i saw when i uncommented). I changed a few things to make it work. If it's ok for you, you can just merge. Anyway thanks for this great work ! --- ios/CsZBar.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ios/CsZBar.m b/ios/CsZBar.m index 6df2520..a1e735d 100644 --- a/ios/CsZBar.m +++ b/ios/CsZBar.m @@ -72,10 +72,10 @@ - (void)scan: (CDVInvokedUrlCommand*)command; CGFloat dim = screenWidth < screenHeight ? screenWidth / 1.1 : screenHeight / 1.1; UIView *polygonView = [[UIView alloc] initWithFrame: CGRectMake ( (screenWidth/2) - (dim/2), (screenHeight/2) - (dim/2), dim, dim)]; //polygonView.center = self.scanReader.view.center; - //polygonView.layer.borderColor = [UIColor greenColor].CGColor; - //polygonView.layer.borderWidth = 3.0f; + polygonView.layer.borderColor = [UIColor whiteColor].CGColor; + polygonView.layer.borderWidth = 3.0f; - UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(dim / 2, 0, 1, dim)]; + UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(0, dim / 2, dim, 1)]; lineView.backgroundColor = [UIColor redColor]; [polygonView addSubview:lineView];