Revision: 3129
http://skim-app.svn.sourceforge.net/skim-app/?rev=3129&view=rev
Author: hofman
Date: 2007-11-02 07:41:57 -0700 (Fri, 02 Nov 2007)
Log Message:
-----------
Grow cursor area for resizable active annotation. Fix resizing annotations when
dragging past minimum size.
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2007-11-02 13:21:16 UTC (rev 3128)
+++ trunk/SKPDFView.m 2007-11-02 14:41:57 UTC (rev 3129)
@@ -2969,6 +2969,7 @@
newBounds.size.width = NSMaxX(pageBounds) -
NSMinX(newBounds);
}
if (NSWidth(newBounds) < 8.0) {
+ newBounds.origin.x = NSMaxX(newBounds) - 8.0;
newBounds.size.width = 8.0;
}
}
@@ -2987,6 +2988,7 @@
newBounds.size.height = NSMaxY(pageBounds) -
NSMinY(newBounds);
}
if (NSHeight(newBounds) < 8.0) {
+ newBounds.origin.y = NSMaxY(newBounds) - 8.0;
newBounds.size.height = 8.0;
}
}
@@ -3654,6 +3656,8 @@
PDFPage *page = [self pageForPoint:p nearest:NO];
p = [self convertPoint:p toPage:page];
PDFAreaOfInterest area = [self
areaOfInterestForMouse:theEvent];
+ if ([activeAnnotation isResizable] && [[activeAnnotation page]
isEqual:page] && [activeAnnotation hitTest:p])
+ area = kPDFAnnotationArea;
BOOL canSelectOrDrag = area == kPDFNoArea || toolMode ==
SKTextToolMode || hideNotes || annotationMode == SKHighlightNote ||
annotationMode == SKUnderlineNote || annotationMode == SKStrikeOutNote;
if (readingBar && [[readingBar page] isEqual:page] &&
NSPointInRect(p, [readingBar currentBoundsForBox:[self displayBox]]))
cursor = p.y < NSMinY([readingBar currentBounds]) + 3.0 ?
[NSCursor resizeUpDownCursor] : [NSCursor openHandCursor];
@@ -3843,14 +3847,14 @@
static void SKCGContextDrawGrabHandles(CGContextRef context, CGRect rect,
float radius)
{
- SKCGContextDrawGrabHandle(context, CGPointMake(CGRectGetMinX(rect),
CGRectGetMinY(rect)), radius);
- SKCGContextDrawGrabHandle(context, CGPointMake(CGRectGetMinX(rect),
CGRectGetMaxY(rect)), radius);
- SKCGContextDrawGrabHandle(context, CGPointMake(CGRectGetMaxX(rect),
CGRectGetMinY(rect)), radius);
- SKCGContextDrawGrabHandle(context, CGPointMake(CGRectGetMaxX(rect),
CGRectGetMaxY(rect)), radius);
SKCGContextDrawGrabHandle(context, CGPointMake(CGRectGetMinX(rect),
CGRectGetMidY(rect)), radius);
SKCGContextDrawGrabHandle(context, CGPointMake(CGRectGetMaxX(rect),
CGRectGetMidY(rect)), radius);
+ SKCGContextDrawGrabHandle(context, CGPointMake(CGRectGetMidX(rect),
CGRectGetMaxY(rect)), radius);
SKCGContextDrawGrabHandle(context, CGPointMake(CGRectGetMidX(rect),
CGRectGetMinY(rect)), radius);
- SKCGContextDrawGrabHandle(context, CGPointMake(CGRectGetMidX(rect),
CGRectGetMaxY(rect)), radius);
+ SKCGContextDrawGrabHandle(context, CGPointMake(CGRectGetMinX(rect),
CGRectGetMaxY(rect)), radius);
+ SKCGContextDrawGrabHandle(context, CGPointMake(CGRectGetMinX(rect),
CGRectGetMinY(rect)), radius);
+ SKCGContextDrawGrabHandle(context, CGPointMake(CGRectGetMaxX(rect),
CGRectGetMaxY(rect)), radius);
+ SKCGContextDrawGrabHandle(context, CGPointMake(CGRectGetMaxX(rect),
CGRectGetMinY(rect)), radius);
}
@implementation PDFDocument (SKExtensions)
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit