Revision: 7677
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7677&view=rev
Author:   hofman
Date:     2012-03-02 11:26:46 +0000 (Fri, 02 Mar 2012)
Log Message:
-----------
slight extension of display rect for ink and line notes

Modified Paths:
--------------
    trunk/PDFAnnotationInk_SKExtensions.m
    trunk/PDFAnnotationLine_SKExtensions.m

Modified: trunk/PDFAnnotationInk_SKExtensions.m
===================================================================
--- trunk/PDFAnnotationInk_SKExtensions.m       2012-03-01 18:21:51 UTC (rev 
7676)
+++ trunk/PDFAnnotationInk_SKExtensions.m       2012-03-02 11:26:46 UTC (rev 
7677)
@@ -165,6 +165,8 @@
 
 - (NSRect)displayRectForBounds:(NSRect)bounds lineWidth:(CGFloat)lineWidth {
     NSRect rect = NSZeroRect;
+    if (lineWidth < 1.0)
+        lineWidth = 1.0;
     for (NSBezierPath *path in [self paths])
         rect = NSUnionRect(rect, NSInsetRect([path nonEmptyBounds], 
-lineWidth, -lineWidth));
     rect.origin = SKAddPoints(rect.origin, bounds.origin);

Modified: trunk/PDFAnnotationLine_SKExtensions.m
===================================================================
--- trunk/PDFAnnotationLine_SKExtensions.m      2012-03-01 18:21:51 UTC (rev 
7676)
+++ trunk/PDFAnnotationLine_SKExtensions.m      2012-03-02 11:26:46 UTC (rev 
7677)
@@ -109,10 +109,15 @@
 }
 
 - (NSRect)displayRectForBounds:(NSRect)bounds lineWidth:(CGFloat)lineWidth {
-    bounds = [super displayRectForBounds:bounds lineWidth:lineWidth];
+    NSRect rect = [super displayRectForBounds:bounds lineWidth:lineWidth];
     // need a large padding amount for large line width and cap changes
     CGFloat delta = ceil(fmax(2.0 * lineWidth, 2.0));
-    return NSInsetRect(bounds, -delta, -delta);
+    rect = NSInsetRect(rect, -delta, -delta);
+    if (NSWidth(bounds) < 3.0 * delta)
+        rect = NSInsetRect(rect, -delta, 0.0);
+    if (NSHeight(bounds) < 3.0 * delta)
+        rect = NSInsetRect(rect, 0.0, -delta);
+    return rect;
 }
 
 - (SKRectEdges)resizeHandleForPoint:(NSPoint)point 
scaleFactor:(CGFloat)scaleFactor {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to