File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Sources/W3WSwiftComponentsOcr Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -526,17 +526,14 @@ open class W3WOcrViewController: W3WViewController {
526526 height = width * W3WSettings. ocrViewfinderRatioLandscape
527527 }
528528 let crop = CGRect ( origin: CGPoint ( x: ( UIScreen . main. bounds. width - width) / 2 ,
529- y: topMargin + max ( closeButtonSize, W3WMargin . heavy . value ) + W3WMargin. light. value) ,
529+ y: topMargin + closeButtonSize + W3WMargin. light. value) ,
530530 size: CGSize ( width: width, height: height) )
531531 ocrView. set ( crop: crop)
532532 }
533533 }
534534
535535 var topMargin : CGFloat {
536- if isPresentedModally ( ) {
537- return modalPresentationStyle == . fullScreen ? W3WSettings . topSafeArea : 0.0
538- }
539- return W3WSettings . topSafeArea
536+ return shouldShowCloseButton ? closeButton. frame. minY : W3WMargin . heavy. value
540537 }
541538
542539 /// w3w Logo
@@ -566,6 +563,7 @@ open class W3WOcrViewController: W3WViewController {
566563 closeButton. trailingAnchor. constraint ( equalTo: view. trailingAnchor) ,
567564 closeButton. topAnchor. constraint ( equalTo: view. safeAreaLayoutGuide. topAnchor)
568565 ] )
566+ closeButton. setNeedsLayout ( )
569567 }
570568
571569 @objc open func didTouchCloseButton( ) {
You can’t perform that action at this time.
0 commit comments