diff --git a/Sources/Edit/ZLClipOverlayView.swift b/Sources/Edit/ZLClipOverlayView.swift index b3f55a83..36c92ce3 100644 --- a/Sources/Edit/ZLClipOverlayView.swift +++ b/Sources/Edit/ZLClipOverlayView.swift @@ -84,7 +84,6 @@ class ZLClipOverlayView: UIView { } shadowMaskLayer.path = getShadowMaskLayerPath().cgPath - gridLinesLayer.path = getGridLinesLayerPath().cgPath } } @@ -168,22 +167,20 @@ class ZLClipOverlayView: UIView { private func getGridLinesLayerPath() -> UIBezierPath { let path = UIBezierPath() - let r = cropRect.width / 2 - let diff = isCircle ? r - sqrt(pow(r, 2) - pow(r / 3, 2)) : 0 // 画竖线 let dw = cropRect.width / 3 for i in 1...2 { let x = CGFloat(i) * dw + cropRect.minX - path.move(to: CGPoint(x: x, y: cropRect.minY + diff)) - path.addLine(to: CGPoint(x: x, y: cropRect.maxY - diff)) + path.move(to: CGPoint(x: x, y: cropRect.minY)) + path.addLine(to: CGPoint(x: x, y: cropRect.maxY)) } // 画横线 let dh = cropRect.height / 3 for i in 1...2 { let y = CGFloat(i) * dh + cropRect.minY - path.move(to: CGPoint(x: cropRect.minX + diff, y: y)) - path.addLine(to: CGPoint(x: cropRect.maxX - diff, y: y)) + path.move(to: CGPoint(x: cropRect.minX, y: y)) + path.addLine(to: CGPoint(x: cropRect.maxX, y: y)) } return path diff --git a/Sources/Edit/ZLEditImageViewController.swift b/Sources/Edit/ZLEditImageViewController.swift index 993ec7d6..27874b77 100644 --- a/Sources/Edit/ZLEditImageViewController.swift +++ b/Sources/Edit/ZLEditImageViewController.swift @@ -1143,8 +1143,15 @@ open class ZLEditImageViewController: UIViewController { var editModel: ZLEditImageModel? func callback() { - dismiss(animated: animate) { - self.editFinishBlock?(resImage, editModel) + // 内部自己调用,先回调在退出 + if let nav = presentingViewController as? ZLImageNavController, + nav.topViewController is ZLPhotoPreviewController { + editFinishBlock?(resImage, editModel) + dismiss(animated: animate) + } else { + dismiss(animated: animate) { + self.editFinishBlock?(resImage, editModel) + } } }