Skip to content

Commit e74c306

Browse files
author
Thy Nguyen
committed
Fix UI issue on iPad
1 parent 4c238b6 commit e74c306

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/W3WSwiftComponentsOcr/W3WOcrViewController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -518,14 +518,14 @@ open class W3WOcrViewController: W3WViewController {
518518
let height: CGFloat
519519
if UIScreen.main.bounds.width < UIScreen.main.bounds.height {
520520
// potrait
521-
width = UIScreen.main.bounds.width - inset * 2.0
521+
width = view.bounds.width - inset * 2.0
522522
height = width
523523
} else {
524524
// landscape
525-
width = UIScreen.main.bounds.width * 0.8 - inset * 2.0
525+
width = view.bounds.width * 0.8 - inset * 2.0
526526
height = width * W3WSettings.ocrViewfinderRatioLandscape
527527
}
528-
let crop = CGRect(origin: CGPoint(x: (UIScreen.main.bounds.width - width) / 2,
528+
let crop = CGRect(origin: CGPoint(x: (view.bounds.width - width) / 2,
529529
y: topMargin + closeButtonSize + W3WMargin.light.value),
530530
size: CGSize(width: width, height: height))
531531
ocrView.set(crop: crop)

0 commit comments

Comments
 (0)