Revision: 15139
          http://sourceforge.net/p/skim-app/code/15139
Author:   hofman
Date:     2025-05-01 22:20:41 +0000 (Thu, 01 May 2025)
Log Message:
-----------
Get point for tooltip image when needed

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

Modified: trunk/SKImageToolTipWindow.m
===================================================================
--- trunk/SKImageToolTipWindow.m        2025-05-01 21:54:51 UTC (rev 15138)
+++ trunk/SKImageToolTipWindow.m        2025-05-01 22:20:41 UTC (rev 15139)
@@ -136,9 +136,7 @@
     generatingRequest = YES;
     
     NSInteger myRequest = currentRequest;
-    id<SKImageToolTipContext> myContext = context;
-    NSPoint thePoint = NSEqualPoints(point, NSZeroPoint) ? [NSEvent 
mouseLocation] : point;
-    NSRect screenRect = [[NSScreen screenForPoint:thePoint] frame];
+    id<SKImageToolTipContext> theContext = context;
     NSNumber *usedScaleNumber = [[NSUserDefaults standardUserDefaults] 
objectForKey:SKToolTipScaleKey];
     CGFloat usedScale = [usedScaleNumber 
respondsToSelector:@selector(doubleValue)] ? [usedScaleNumber doubleValue] : 
DEFAULT_SCALE;
     if (usedScale <= 0.0)
@@ -146,7 +144,7 @@
     
     dispatch_async([[self class] imageQueue], ^{
         
-        NSImage *image = [myContext toolTipImageWithScale:usedScale];
+        NSImage *image = [theContext toolTipImageWithScale:usedScale];
         
         dispatch_async(dispatch_get_main_queue(), ^{
             // check if another image is enerated or we are fading out
@@ -161,6 +159,8 @@
                 
                 [[self contentView] setContentFilters:isOpaque ? 
SKColorEffectFilters() : @[]];
                 
+                NSPoint thePoint = NSEqualPoints(point, NSZeroPoint) ? 
[NSEvent mouseLocation] : point;
+                NSRect screenRect = [[NSScreen screenForPoint:thePoint] frame];
                 NSRect contentRect = NSZeroRect;
                 contentRect.size = [image size];
                 contentRect.origin.x = fmin(thePoint.x, NSMaxX(screenRect) - 
NSWidth(contentRect));

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



_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to