|
@@ -1830,8 +1830,8 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
|
|
|
NSUInteger eventMask = NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged;
|
|
|
CGRect rect = CGRectZero;
|
|
|
while (YES) {
|
|
|
- theEvent = [window nextEventMatchingMask:eventMask];
|
|
|
- if ([theEvent type] == NSEventTypeLeftMouseUp) {
|
|
|
+ NSEvent *nextEvent = [window nextEventMatchingMask:eventMask];
|
|
|
+ if ([nextEvent type] == NSEventTypeLeftMouseUp) {
|
|
|
if (!CGSizeEqualToSize(rect.size, CGSizeZero)) {
|
|
|
if ([self.activeAnnotation isKindOfClass:[CPDFLinkAnnotation class]]) {
|
|
|
CPDFLinkAnnotation *linkAnnotation = (CPDFLinkAnnotation *)self.activeAnnotation;
|
|
@@ -1843,13 +1843,26 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
|
|
|
[self.pdfListViewDelegate PDFListViewLinkDestinationEnd:self withActiveAnnotation:self.activeAnnotation];
|
|
|
}
|
|
|
}
|
|
|
+ } else {
|
|
|
+ if ([lastMouseEvent isEqual:theEvent]) { // 点击事件(没有拖拽)
|
|
|
+ if ([self.activeAnnotation isKindOfClass:[CPDFLinkAnnotation class]]) {
|
|
|
+ CPDFLinkAnnotation *linkAnnotation = (CPDFLinkAnnotation *)self.activeAnnotation;
|
|
|
+ CPDFDestination *destination = [[CPDFDestination alloc]initWithDocument:self.document pageIndex:[self.document indexForPage:page] atPoint:point zoom:self.scaleFactor];
|
|
|
+ [linkAnnotation setDestination:destination];
|
|
|
+ self.isSetLinkDestinationArea = NO;
|
|
|
+ [self goToRect:linkAnnotation.bounds onPage:self.activeAnnotation.page];
|
|
|
+ if([self.pdfListViewDelegate respondsToSelector:@selector(PDFListViewLinkDestinationEnd:withActiveAnnotation:)]) {
|
|
|
+ [self.pdfListViewDelegate PDFListViewLinkDestinationEnd:self withActiveAnnotation:self.activeAnnotation];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
break;
|
|
|
- } else if ([theEvent type] == NSEventTypeLeftMouseDragged) {
|
|
|
+ } else if ([nextEvent type] == NSEventTypeLeftMouseDragged) {
|
|
|
rect = [self doResizeLinkWithEvent:lastMouseEvent fromPoint:point originalBounds:originalBounds page:page resizeHandle:&resizeHandle];
|
|
|
bezierPath = [NSBezierPath bezierPathWithRect:rect];
|
|
|
[layer setPath:[bezierPath PDFListViewCGPath]];
|
|
|
- lastMouseEvent = theEvent;
|
|
|
+ lastMouseEvent = nextEvent;
|
|
|
}
|
|
|
}
|
|
|
|