Revision: 14147
          http://sourceforge.net/p/skim-app/code/14147
Author:   hofman
Date:     2024-03-26 15:44:36 +0000 (Tue, 26 Mar 2024)
Log Message:
-----------
Different variables for rects

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

Modified: trunk/SKSnapshotWindowController.m
===================================================================
--- trunk/SKSnapshotWindowController.m  2024-03-26 10:47:37 UTC (rev 14146)
+++ trunk/SKSnapshotWindowController.m  2024-03-26 15:44:36 UTC (rev 14147)
@@ -618,29 +618,23 @@
         NSArray *filters = SKColorEffectFilters();
         NSImage *contentImage = [self thumbnailWithSize:-1.0];
         NSImage *windowImage;
-        NSRect startRect, endRect;
+        NSRect windowRect = [window frame];
         NSRect dockRect = [[self delegate] snapshotController:self 
miniaturizedRect:miniaturize];
         dockRect = [self miniaturizedRectForDockingRect:dockRect];
         
         if (miniaturize) {
-            endRect = [[self window] frame];
-            startRect = dockRect;
-            
             CGImageRef cgImage = CGWindowListCreateImage(CGRectNull, 
kCGWindowListOptionIncludingWindow, (CGWindowID)[window windowNumber], 
kCGWindowImageBoundsIgnoreFraming);
-            windowImage = [[NSImage alloc] initWithCGImage:cgImage 
size:[window frame].size];
+            windowImage = [[NSImage alloc] initWithCGImage:cgImage 
size:windowRect.size];
             CGImageRelease(cgImage);
         } else {
-            startRect = [[self window] frame];
-            endRect = dockRect;
-            
             NSBitmapImageRep *imageRep = [[[window contentView] superview] 
bitmapImageRepCachingDisplay];
             if ([filters count] > 0 && [NSScroller preferredScrollerStyle] == 
NSScrollerStyleLegacy)
                 applyFiltersToImageRep(imageRep, filters, [window 
contentLayoutRect]);
-            windowImage = [[NSImage alloc] initWithSize:[window frame].size];
+            windowImage = [[NSImage alloc] initWithSize:windowRect.size];
             [windowImage addRepresentation:imageRep];
         }
         
-        SKAnimatedBorderlessWindow *miniaturizeWindow = 
[[SKAnimatedBorderlessWindow alloc] initWithContentRect:startRect];
+        SKAnimatedBorderlessWindow *miniaturizeWindow = 
[[SKAnimatedBorderlessWindow alloc] initWithContentRect:miniaturize ? 
windowRect : dockRect];
         [miniaturizeWindow setLevel:NSFloatingWindowLevel];
         [miniaturizeWindow setHasShadow:YES];
         [[miniaturizeWindow contentView] setWantsLayer:YES];
@@ -661,8 +655,8 @@
         animating = YES;
         
         [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){
-                [context setDuration:RESIZE_TIME_FACTOR * [miniaturizeWindow 
animationResizeTime:endRect]];
-                [[miniaturizeWindow animator] setFrame:endRect display:YES];
+            [context setDuration:RESIZE_TIME_FACTOR * [miniaturizeWindow 
animationResizeTime:miniaturize ? dockRect : windowRect]];
+                [[miniaturizeWindow animator] setFrame:miniaturize ? dockRect 
: windowRect display:YES];
                 [[imageView animator] setAlphaValue:miniaturize ? 0.0 : 1.0];
             }
             completionHandler:^{
@@ -678,7 +672,7 @@
     } else if (miniaturize) {
         [[self window] orderOut:nil];
     } else {
-        [self showWindow:nil];
+        [[self window] orderFront:nil];
     }
     [self setHasWindow:miniaturize == NO];
 }

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



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to