Revision: 22917
          http://sourceforge.net/p/bibdesk/svn/22917
Author:   hofman
Date:     2018-11-01 22:07:47 +0000 (Thu, 01 Nov 2018)
Log Message:
-----------
use convenience method to convert between view and screen coordinates

Modified Paths:
--------------
    trunk/bibdesk/BDSKComplexStringEditor.m
    trunk/bibdesk/BDSKFileMatcher.m
    trunk/bibdesk/BDSKOrphanedFilesFinder.m
    trunk/bibdesk/BDSKOverlayWindow.m
    trunk/bibdesk/BDSKStatusBar.m
    trunk/bibdesk/BDSKTextViewCompletionController.m

Modified: trunk/bibdesk/BDSKComplexStringEditor.m
===================================================================
--- trunk/bibdesk/BDSKComplexStringEditor.m     2018-11-01 21:57:36 UTC (rev 
22916)
+++ trunk/bibdesk/BDSKComplexStringEditor.m     2018-11-01 22:07:47 UTC (rev 
22917)
@@ -40,6 +40,7 @@
 #import "BDSKBackgroundView.h"
 #import "NSWindowController_BDSKExtensions.h"
 #import "NSGeometry_BDSKExtensions.h"
+#import "NSView_BDSKExtensions.h"
 
 @interface BDSKComplexStringEditor (Private)
 
@@ -218,8 +219,8 @@
                return;
        }
        
-       lowerEdgeRect = [tableView convertRect:lowerEdgeRect toView:nil]; // 
takes into account isFlipped
-    winFrame.origin = [[tableView window] 
convertBaseToScreen:lowerEdgeRect.origin];
+       lowerEdgeRect = [tableView convertRectToScreen:lowerEdgeRect]; // takes 
into account isFlipped
+    winFrame.origin = lowerEdgeRect.origin;
        winFrame.origin.y -= NSHeight(winFrame);
        winFrame.size.width = fmax(NSWidth(lowerEdgeRect), minWidth);
        winFrame = NSInsetRect(winFrame, -margin, 0.0);

Modified: trunk/bibdesk/BDSKFileMatcher.m
===================================================================
--- trunk/bibdesk/BDSKFileMatcher.m     2018-11-01 21:57:36 UTC (rev 22916)
+++ trunk/bibdesk/BDSKFileMatcher.m     2018-11-01 22:07:47 UTC (rev 22917)
@@ -56,6 +56,7 @@
 #import "NSWindowController_BDSKExtensions.h"
 #import "NSPasteboard_BDSKExtensions.h"
 #import "NSEvent_BDSKExtensions.h"
+#import "NSView_BDSKExtensions.h"
 
 #define BDSKShouldLogFilesAddedToMatchingSearchIndexKey 
@"BDSKShouldLogFilesAddedToMatchingSearchIndex"
 
@@ -439,8 +440,7 @@
     if (item != nil && row != -1) {
         iconRect = [(BDSKTextWithIconCell *)[outlineView 
preparedCellAtColumn:0 row:row] iconRectForBounds:[outlineView 
frameOfCellAtColumn:0 row:row]];
         if (NSIntersectsRect([outlineView visibleRect], iconRect)) {
-            iconRect = [outlineView convertRectToBase:iconRect];
-            iconRect.origin = [[self window] 
convertBaseToScreen:iconRect.origin];
+            iconRect = [outlineView convertRectToScreen:iconRect];
         } else {
             iconRect = NSZeroRect;
         }

Modified: trunk/bibdesk/BDSKOrphanedFilesFinder.m
===================================================================
--- trunk/bibdesk/BDSKOrphanedFilesFinder.m     2018-11-01 21:57:36 UTC (rev 
22916)
+++ trunk/bibdesk/BDSKOrphanedFilesFinder.m     2018-11-01 22:07:47 UTC (rev 
22917)
@@ -58,6 +58,7 @@
 #import <libkern/OSAtomic.h>
 #import "BDSKFilePathCell.h"
 #import "NSEvent_BDSKExtensions.h"
+#import "NSView_BDSKExtensions.h"
 
 #define BDSKOrphanedFilesWindowFrameAutosaveName @"BDSKOrphanedFilesWindow"
 
@@ -427,8 +428,7 @@
     if (item != nil && row != NSNotFound) {
         iconRect = [(BDSKFilePathCell *)[tableView preparedCellAtColumn:0 
row:row] iconRectForBounds:[tableView frameOfCellAtColumn:0 row:row]];
         if (NSIntersectsRect([tableView visibleRect], iconRect)) {
-            iconRect = [tableView convertRectToBase:iconRect];
-            iconRect.origin = [[self window] 
convertBaseToScreen:iconRect.origin];
+            iconRect = [tableView convertRectToScreen:iconRect];
         } else {
             iconRect = NSZeroRect;
         }

Modified: trunk/bibdesk/BDSKOverlayWindow.m
===================================================================
--- trunk/bibdesk/BDSKOverlayWindow.m   2018-11-01 21:57:36 UTC (rev 22916)
+++ trunk/bibdesk/BDSKOverlayWindow.m   2018-11-01 22:07:47 UTC (rev 22917)
@@ -38,6 +38,7 @@
  */
 
 #import "BDSKOverlayWindow.h"
+#import "NSView_BDSKExtensions.h"
 
 
 @implementation BDSKOverlayWindow
@@ -69,8 +70,7 @@
 }
 
 - (void)parentViewFrameChanged:(NSNotification *)notification {
-       NSRect viewRect = [parentView convertRect:[parentView bounds] 
toView:nil];
-    viewRect.origin = [[parentView window] 
convertBaseToScreen:viewRect.origin];
+       NSRect viewRect = [parentView convertRectToScreen:[parentView bounds]];
        [self setFrame:[self frameRectForContentRect:viewRect] display:YES];
 }
 
@@ -165,8 +165,7 @@
 }
 
 - (void)parentViewFrameChanged:(NSNotification *)notification {
-       NSRect viewRect = [parentView convertRect:[parentView bounds] 
toView:nil];
-    viewRect.origin = [[parentView window] 
convertBaseToScreen:viewRect.origin];
+       NSRect viewRect = [parentView convertRectToScreen:[parentView bounds]];
        [self setFrame:[self frameRectForContentRect:viewRect] display:YES];
 }
 

Modified: trunk/bibdesk/BDSKStatusBar.m
===================================================================
--- trunk/bibdesk/BDSKStatusBar.m       2018-11-01 21:57:36 UTC (rev 22916)
+++ trunk/bibdesk/BDSKStatusBar.m       2018-11-01 22:07:47 UTC (rev 22917)
@@ -39,6 +39,7 @@
 #import "BDSKStatusBar.h"
 #import "NSGeometry_BDSKExtensions.h"
 #import "NSAnimationContext_BDSKExtensions.h"
+#import "NSView_BDSKExtensions.h"
 
 #define LEFT_MARGIN                            5.0
 #define RIGHT_MARGIN                   15.0
@@ -392,7 +393,7 @@
 }
 
 - (id)accessibilityHitTest:(NSPoint)point {
-    NSPoint localPoint = [self convertPoint:[[self window] 
convertScreenToBase:point] fromView:nil];
+    NSPoint localPoint = [self convertPointFromScreen:point];
     NSRect rect, childRect;
     
     rect = BDSKShrinkRect(BDSKShrinkRect([self bounds], leftMargin, 
NSMinXEdge), rightMargin, NSMaxXEdge);

Modified: trunk/bibdesk/BDSKTextViewCompletionController.m
===================================================================
--- trunk/bibdesk/BDSKTextViewCompletionController.m    2018-11-01 21:57:36 UTC 
(rev 22916)
+++ trunk/bibdesk/BDSKTextViewCompletionController.m    2018-11-01 22:07:47 UTC 
(rev 22917)
@@ -39,6 +39,7 @@
 #import "BDSKTextViewCompletionController.h"
 #import "NSTextView_BDSKExtensions.h"
 #import "NSScrollView_BDSKExtensions.h"
+#import "NSView_BDSKExtensions.h"
 
 @interface BDSKTextViewCompletionWindow : NSWindow @end
 
@@ -407,7 +408,7 @@
         point.x = [tv visibleRect].origin.x;
     
     // convert to screen coordinates
-    point = [[tv window] convertBaseToScreen:[tv convertPoint:point 
toView:nil]];
+    point = [tv convertPointToScreen:point];
     
     return point;
 }

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



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to