Revision: 4648
          http://skim-app.svn.sourceforge.net/skim-app/?rev=4648&view=rev
Author:   hofman
Date:     2008-09-17 11:54:49 +0000 (Wed, 17 Sep 2008)

Log Message:
-----------
take linewidth into account of dirty rect for ink note

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

Modified: trunk/PDFAnnotationInk_SKExtensions.m
===================================================================
--- trunk/PDFAnnotationInk_SKExtensions.m       2008-09-16 20:49:47 UTC (rev 
4647)
+++ trunk/PDFAnnotationInk_SKExtensions.m       2008-09-17 11:54:49 UTC (rev 
4648)
@@ -116,9 +116,14 @@
 }
 
 - (NSRect)displayRectForBounds:(NSRect)bounds {
-    bounds = [super displayRectForBounds:bounds];
-    // need a large padding amount for large line width changes, we may have 
this depend on the line width
-    return NSInsetRect(bounds, -8.0, -8.0);
+    float lineWidth = [self lineWidth];
+    NSEnumerator *pathEnum = [[self paths] objectEnumerator];
+    NSBezierPath *path;
+    NSRect rect = NSZeroRect;
+    while (path = [pathEnum nextObject])
+        rect = NSUnionRect(rect, NSInsetRect([path bounds], -lineWidth, 
-lineWidth));
+    rect.origin = NSAddPoints(rect.origin, bounds.origin);
+    return NSUnionRect([super displayRectForBounds:bounds], 
NSIntegralRect(rect));
 }
 
 - (NSArray *)pointLists {


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 the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to