Revision: 3346
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3346&view=rev
Author:   hofman
Date:     2008-01-06 14:52:25 -0800 (Sun, 06 Jan 2008)

Log Message:
-----------
Avoid some code duplication.

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

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2008-01-06 22:47:23 UTC (rev 3345)
+++ trunk/SKPDFView.m   2008-01-06 22:52:25 UTC (rev 3346)
@@ -1445,32 +1445,30 @@
 
 #pragma mark Tracking mousemoved fix
 
-- (void)setFrame:(NSRect)frame {
-    [super setFrame:frame];
+- (void)resetBoundsTrackingRect {
     if ([self window] && trackingRect)
         [self removeTrackingRect:trackingRect];
     trackingRect = [self addTrackingRect:[self bounds] owner:self 
userData:NULL assumeInside:NO];
 }
 
+- (void)setFrame:(NSRect)frame {
+    [super setFrame:frame];
+    [self resetBoundsTrackingRect];
+}
+
 - (void)setFrameSize:(NSSize)size {
     [super setFrameSize:size];
-    if ([self window] && trackingRect)
-        [self removeTrackingRect:trackingRect];
-    trackingRect = [self addTrackingRect:[self bounds] owner:self 
userData:NULL assumeInside:NO];
+    [self resetBoundsTrackingRect];
 }
  
 - (void)setBounds:(NSRect)bounds {
     [super setBounds:bounds];
-    if ([self window] && trackingRect)
-        [self removeTrackingRect:trackingRect];
-    trackingRect = [self addTrackingRect:[self bounds] owner:self 
userData:NULL assumeInside:NO];
+    [self resetBoundsTrackingRect];
 }
  
 - (void)setBoundsSize:(NSSize)size {
     [super setBoundsSize:size];
-    if ([self window] && trackingRect)
-        [self removeTrackingRect:trackingRect];
-    trackingRect = [self addTrackingRect:[self bounds] owner:self 
userData:NULL assumeInside:NO];
+    [self resetBoundsTrackingRect];
 }
 
 - (void)viewWillMoveToWindow:(NSWindow *)newWindow {


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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to