Fixed the position of the scan line

This commit is contained in:
Julian Finkler 2020-01-12 12:34:25 +01:00
parent e0cc5c3bc2
commit 770bb47d6c
1 changed files with 6 additions and 6 deletions

View File

@ -89,10 +89,10 @@
CGFloat frameHeight = rect.size.height;
BOOL isLandscape = frameWidth > frameHeight;
CGFloat widthOnPotrait = isLandscape ? frameHeight : frameWidth;
CGFloat heightMultiplier = 3.0/4.0; // 4:3 aspect ratio
CGFloat scanRectWidth = widthOnPotrait * 0.8f;
CGFloat scanRectHeight = scanRectWidth * heightMultiplier;
CGFloat widthOnPortrait = isLandscape ? frameHeight : frameWidth;
CGFloat scanRectWidth = widthOnPortrait * 0.8f;
CGFloat aspectRatio = 3.0/4.0;
CGFloat scanRectHeight = scanRectWidth * aspectRatio;
if(isLandscape) {
CGFloat navbarHeight = 32;
@ -106,8 +106,8 @@
- (CGRect)scanLineRect {
CGRect scanRect = [self scanRect];
CGRect rect = self.frame;
return CGRectMake(scanRect.origin.x, rect.size.height / 2, scanRect.size.width, 1);
CGFloat positionY = scanRect.origin.y + (scanRect.size.height / 2);
return CGRectMake(scanRect.origin.x, positionY, scanRect.size.width, 1);
}
@end