|
@@ -444,7 +444,6 @@ struct KMNMWCFlags {
|
|
|
listView.toolMode = .editPDFToolMode
|
|
|
listView.configPDFEditingInfo()
|
|
|
}
|
|
|
- listView.annotationType = .editTextImage
|
|
|
listView.setShouAddEdit([])
|
|
|
listView.change([.text, .image])
|
|
|
|
|
@@ -453,7 +452,6 @@ struct KMNMWCFlags {
|
|
|
listView.toolMode = .editPDFToolMode
|
|
|
listView.configPDFEditingInfo()
|
|
|
}
|
|
|
- listView.annotationType = .addText
|
|
|
listView.setShouAddEdit([.text])
|
|
|
listView.change(.text)
|
|
|
|
|
@@ -462,7 +460,6 @@ struct KMNMWCFlags {
|
|
|
listView.toolMode = .editPDFToolMode
|
|
|
listView.configPDFEditingInfo()
|
|
|
}
|
|
|
- listView.annotationType = .addImage
|
|
|
listView.setShouAddEdit([.image])
|
|
|
listView.change(.image)
|
|
|
|
|
@@ -1271,6 +1268,11 @@ struct KMNMWCFlags {
|
|
|
if popWindow.window?.isVisible == false {
|
|
|
reloadPopUIContentEdits(editAreas: editAreas)
|
|
|
} else {
|
|
|
+ let editingAreas = listView.km_EditingAreas()
|
|
|
+ let editMode = KMNEditContentPopMode(currentEditAreas: editingAreas)
|
|
|
+ if popWindow.editType != editMode.popType || editingAreas != popWindow.editContentPopMode.editAreas {
|
|
|
+ popWindow.editContentPopMode = editMode
|
|
|
+ }
|
|
|
updateContentEditPopWinodwFrame()
|
|
|
}
|
|
|
return
|
|
@@ -2933,6 +2935,7 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
|
|
|
if editArea != nil && (editArea is CPDFEditImageArea){
|
|
|
self.listView.cropAreas = editArea as? CPDFEditImageArea
|
|
|
}
|
|
|
+ reloadPopUIWindow()
|
|
|
}
|
|
|
|
|
|
//编辑PDF 创建图片区域回调
|
|
@@ -3100,6 +3103,8 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
|
|
|
|
|
|
func pdfViewEditingExitCropMode(_ pdfView: CPDFView!, forEditing editingArea: CPDFEditImageArea!) {
|
|
|
rightSideController?.reloadEditingAreas()
|
|
|
+
|
|
|
+ toggleClosePopUIWindow()
|
|
|
}
|
|
|
|
|
|
func pdfViewEditingOperationDidChanged(_ pdfView: CPDFView!) {
|
|
@@ -3200,7 +3205,7 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
|
|
|
}
|
|
|
}
|
|
|
} else if (theEvent.keyCode == 36) {
|
|
|
- if self.listView.annotationType == .addImage || self.listView.annotationType == .addText {
|
|
|
+ if self.listView.shouAddEditAreaType() == .image || self.listView.shouAddEditAreaType() == .text {
|
|
|
if self.listView.isEditImage {
|
|
|
self.menuItemEditingClick_CropImage(sender: NSMenuItem())
|
|
|
}
|
|
@@ -5419,31 +5424,29 @@ extension KMMainViewController {
|
|
|
if self!.listView.editingAreas().count > 0 && self!.listView.isEditable() {
|
|
|
self!.listView.clearEditingSelectCharItem()
|
|
|
} else if self!.listView.editingAreas().count > 0 {
|
|
|
- if self?.listView.annotationType == .addImage ||
|
|
|
- self?.listView.annotationType == .addText {
|
|
|
+ if self?.listView.shouAddEditAreaType() == .image ||
|
|
|
+ self?.listView.shouAddEditAreaType() == .text {
|
|
|
}
|
|
|
self?.listView.endEditIsRemoveBlock(with: self!.listView.editingAreas().first as? CPDFEditArea)
|
|
|
self?.listView.updateEditing([])
|
|
|
self?.listView.isEditImage = false
|
|
|
self?.listView.setNeedsDisplayPageViewFor(self!.listView.currentPage())
|
|
|
- if self?.listView.annotationType == .addImage {
|
|
|
+ if self?.listView.shouAddEditAreaType() == .image {
|
|
|
self?.listView.change([.text, .image])
|
|
|
}
|
|
|
- self?.listView.annotationType = .editTextImage
|
|
|
self?.toggleCloseRightSide()
|
|
|
- } else if(self?.listView.annotationType == .addImage || self!.listView.annotationType == .addText) {
|
|
|
- if self?.listView.annotationType == .addImage ||
|
|
|
- self?.listView.annotationType == .addText {
|
|
|
+ } else if(self?.listView.shouAddEditAreaType() == .image || self!.listView.shouAddEditAreaType() == .text) {
|
|
|
+ if self?.listView.shouAddEditAreaType() == .image ||
|
|
|
+ self?.listView.shouAddEditAreaType() == .text {
|
|
|
}
|
|
|
self?.listView.setShouAddEdit([])
|
|
|
self?.listView.change([.text, .image])
|
|
|
- self?.listView.annotationType = .editTextImage
|
|
|
self?.toggleCloseRightSide()
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
- if self?.listView.annotationType == .addImage ||
|
|
|
- self?.listView.annotationType == .addText {
|
|
|
+ if self?.listView.shouAddEditAreaType() == .image ||
|
|
|
+ self?.listView.shouAddEditAreaType() == .text {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -5700,7 +5703,7 @@ extension KMMainViewController {
|
|
|
|
|
|
func CEditPDFToolModeChangeStateUnkownNotification(_ sender: Notification) {
|
|
|
var editSelectd = false
|
|
|
- if (self.listView.annotationType == .addText || self.listView.annotationType == .addImage) && self.listView.toolMode == .editPDFToolMode {
|
|
|
+ if (self.listView.shouAddEditAreaType() == .text || self.listView.shouAddEditAreaType() == .image) && self.listView.toolMode == .editPDFToolMode {
|
|
|
editSelectd = true
|
|
|
}
|
|
|
if self.listView.toolMode == .editPDFToolMode {
|