Преглед на файлове

【工具栏】- 点击页面显示时工具栏状态刷新

liaoxiaoyue преди 1 година
родител
ревизия
68cd33e85e
променени са 1 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 4 2
      PDF Office/PDF Office/Class/PDFWindowController/Toolbar/KMToolbarController.swift

+ 4 - 2
PDF Office/PDF Office/Class/PDFWindowController/Toolbar/KMToolbarController.swift

@@ -386,8 +386,10 @@ extension KMToolbarController: KMToolbarViewControllerDelegate {
     }
     
     func toolbarViewController(_ viewController: KMToolbarViewController, clickMode toolMode: KMToolbarViewType, toolbar toolbarItem: KMToolBoxItem) {
-        if toolMode != .Magnify && toolMode != .Move && toolMode != .Select && toolMode != .SelectZoom && toolMode != .LeftPanel && toolMode != .RightPanel {
+        if self.lastItemBox != nil {
             self.lastItemBox.isSelected = false
+        }
+        if toolMode != .Magnify && toolMode != .Move && toolMode != .Select && toolMode != .SelectZoom && toolMode != .LeftPanel && toolMode != .RightPanel {
             if(toolMode == self.toolbarType) {
                 toolbarItem.isSelected = false
             } else {
@@ -395,7 +397,7 @@ extension KMToolbarController: KMToolbarViewControllerDelegate {
                 self.lastItemBox = toolbarItem
             }
         } else {
-            if(toolMode != self.toolbarType) {
+            if(toolMode != self.toolbarType && toolMode != .LeftPanel) {
                 let item : KMToolBoxItem = (self.mainToolBarView?.toolbarItemFindItemIdentifiers(value: KMDocumentAnnotationToolbarItemIdentifier))!
                 item.isSelected = true
                 self.lastItemBox = item