|
@@ -522,15 +522,17 @@
|
|
|
}
|
|
|
|
|
|
- (void)showHUDHint:(CPDFAnnotation *)newActiveAnnotation {
|
|
|
- CPDFListHoverAnnotationViewController *popViewController = [[CPDFListHoverAnnotationViewController alloc] initWithNibName:@"CPDFListHoverAnnotationViewController" bundle:[NSBundle mainBundle] annotation:newActiveAnnotation];
|
|
|
- self.hoverPopOver = [[NSPopover alloc] init];
|
|
|
- self.hoverPopOver.contentViewController = popViewController;
|
|
|
- self.hoverPopOver.animates = NO;
|
|
|
- self.hoverPopOver.behavior = NSPopoverBehaviorSemitransient;
|
|
|
- self.hoverPopOver.backgroundColor = [NSColor colorWithRed:0 green:0 blue:0 alpha:0.8];
|
|
|
- self.hoverPopOver.contentSize = popViewController.view.frame.size;
|
|
|
- CGRect rect = [self convertRect:newActiveAnnotation.bounds fromPage:newActiveAnnotation.page];
|
|
|
- [self.hoverPopOver showRelativeToRect:CGRectMake(rect.origin.x + 10, rect.origin.y, rect.size.width, rect.size.height) ofView:self preferredEdge:NSRectEdgeMaxX];
|
|
|
+ CGRect rect = [self convertRect:newActiveAnnotation.bounds fromPage:newActiveAnnotation.page];
|
|
|
+ if (rect.size.width != 0 && rect.size.height != 0) {
|
|
|
+ CPDFListHoverAnnotationViewController *popViewController = [[CPDFListHoverAnnotationViewController alloc] initWithNibName:@"CPDFListHoverAnnotationViewController" bundle:[NSBundle mainBundle] annotation:newActiveAnnotation];
|
|
|
+ self.hoverPopOver = [[NSPopover alloc] init];
|
|
|
+ self.hoverPopOver.contentViewController = popViewController;
|
|
|
+ self.hoverPopOver.animates = NO;
|
|
|
+ self.hoverPopOver.behavior = NSPopoverBehaviorSemitransient;
|
|
|
+ self.hoverPopOver.backgroundColor = [NSColor colorWithRed:0 green:0 blue:0 alpha:0.8];
|
|
|
+ self.hoverPopOver.contentSize = popViewController.view.frame.size;
|
|
|
+ [self.hoverPopOver showRelativeToRect:CGRectMake(rect.origin.x + 10, rect.origin.y, rect.size.width, rect.size.height) ofView:self preferredEdge:NSRectEdgeMaxX];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- (void)hidenHUDHint {
|