|
@@ -437,11 +437,7 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
|
|
|
|
|
|
NSMenuItem * editNoteItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Edit Note", @"PDFListView") action:@selector(menuItemClick_EditNote:) keyEquivalent:@""];
|
|
|
|
|
|
- if(CSelectToolMode == self.toolMode) {
|
|
|
- if (NSIsEmptyRect([self currentSelectionRect]) == NO) {
|
|
|
- [menu insertItem:copyItem atIndex:0];
|
|
|
- }
|
|
|
- } else {
|
|
|
+ {
|
|
|
CPDFAnnotation *annotation = nil;
|
|
|
|
|
|
if (([self toolMode] == CTextToolMode || [self toolMode] == CNoteToolMode || [self toolMode] == CFormToolMode || [self toolMode] == CSelfSignMode || [self toolMode] == CRedactToolMode) && [self hideNotes] == NO) {
|
|
@@ -558,6 +554,20 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
|
|
|
[menu insertItem:zoomInItem atIndex:0];
|
|
|
[menu insertItem:fitWidthItem atIndex:0];
|
|
|
|
|
|
+ }
|
|
|
+
|
|
|
+ if(CSelectToolMode == self.toolMode) {
|
|
|
+ if (NSIsEmptyRect([self currentSelectionRect]) == NO) {
|
|
|
+ if (NSIsEmptyRect([self currentSelectionRect]) == NO) {
|
|
|
+ NSMenuItem *selectionItem = [menu insertItemWithTitle:NSLocalizedString(@"Zoom To Selection", @"Menu item title") action:@selector(doZoomToAutoSelection:) target:self atIndex:0];
|
|
|
+ [menu insertItem:[NSMenuItem separatorItem] atIndex:0];
|
|
|
+ }
|
|
|
+
|
|
|
+ [menu insertItem:[NSMenuItem separatorItem] atIndex:0];
|
|
|
+ [menu insertItem:copyItem atIndex:0];
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+
|
|
|
if (annotationSel) {
|
|
|
NSDictionary *dictPresentObject = @{@"page":page,@"annotation":annotationSel};
|
|
|
bringForwardItem.representedObject = dictPresentObject;
|
|
@@ -4603,6 +4613,13 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+- (void)doZoomToAutoSelection:(id)sender {
|
|
|
+ NSRect selRect = [self currentSelectionRect];
|
|
|
+ CPDFPage *page = [self currentPage];
|
|
|
+ if (NSIsEmptyRect(selRect) == NO && page)
|
|
|
+ [self zoomToRect:selRect onPage:page];
|
|
|
+}
|
|
|
+
|
|
|
- (IBAction)menuItemClick_FitPage:(id)sender {
|
|
|
CGFloat pageHeight = self.currentPage.size.height;
|
|
|
CGFloat pdfviewHeight = self.bounds.size.height;
|