|
@@ -1589,21 +1589,27 @@ struct KMNMWCFlags {
|
|
popWindow.listView = listView
|
|
popWindow.listView = listView
|
|
if listView.toolMode == .CSelectToolMode {
|
|
if listView.toolMode == .CSelectToolMode {
|
|
popWindow.popType = .crop
|
|
popWindow.popType = .crop
|
|
|
|
+ popWindow.cropCurrentCallback = {[weak self] in
|
|
|
|
+ let rect = self?.listView.currentSelectionRect() ?? CGRect.zero
|
|
|
|
+ let orgPage : CPDFPage = self?.listView.currentSelectionPage() ?? CPDFPage()
|
|
|
|
+ self?.cropPages(atIndexs: [orgPage.pageIndex()], to: [rect])
|
|
|
|
+ self?.closePopOperationWindow()
|
|
|
|
+ }
|
|
} else if listView.toolMode == .COCRToolMode {
|
|
} else if listView.toolMode == .COCRToolMode {
|
|
popWindow.popType = .ocr
|
|
popWindow.popType = .ocr
|
|
|
|
+ popWindow.OCRAction = { [weak self] in
|
|
|
|
+// let rect = self?.listView.currentSelectionRect() ?? CGRect.zero
|
|
|
|
+// let orgPage : CPDFPage = self?.listView.currentSelectionPage() ?? CPDFPage()
|
|
|
|
+// self?.cropPages(atIndexs: [orgPage.pageIndex()], to: [rect])
|
|
|
|
+// self?.closePopOperationWindow()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- updatePopOperationPopWinodwFrame()
|
|
|
|
popWindow.updatePDFViewCallback = {[weak self] in
|
|
popWindow.updatePDFViewCallback = {[weak self] in
|
|
self?.closePopOperationWindow()
|
|
self?.closePopOperationWindow()
|
|
self?.listView.setNeedsDisplayForVisiblePages()
|
|
self?.listView.setNeedsDisplayForVisiblePages()
|
|
}
|
|
}
|
|
|
|
+ updatePopOperationPopWinodwFrame()
|
|
|
|
|
|
- popWindow.cropCurrentCallback = {[weak self] in
|
|
|
|
- let rect = self?.listView.currentSelectionRect() ?? CGRect.zero
|
|
|
|
- let orgPage : CPDFPage = self?.listView.currentSelectionPage() ?? CPDFPage()
|
|
|
|
- self?.cropPages(atIndexs: [orgPage.pageIndex()], to: [rect])
|
|
|
|
- self?.closePopOperationWindow()
|
|
|
|
- }
|
|
|
|
} else {
|
|
} else {
|
|
closePopOperationWindow()
|
|
closePopOperationWindow()
|
|
}
|
|
}
|