Revision: 14136
          http://sourceforge.net/p/skim-app/code/14136
Author:   hofman
Date:     2024-03-24 17:51:16 +0000 (Sun, 24 Mar 2024)
Log Message:
-----------
No need to pass rect to bitmap image rep method, it is always the view's bnounds

Modified Paths:
--------------
    trunk/NSView_SKExtensions.h
    trunk/NSView_SKExtensions.m
    trunk/SKBasePDFView.m
    trunk/SKLineWell.m
    trunk/SKSnapshotWindowController.m
    trunk/SKThumbnailView.m
    trunk/SKTransitionController.m

Modified: trunk/NSView_SKExtensions.h
===================================================================
--- trunk/NSView_SKExtensions.h 2024-03-24 17:46:19 UTC (rev 14135)
+++ trunk/NSView_SKExtensions.h 2024-03-24 17:51:16 UTC (rev 14136)
@@ -56,7 +56,7 @@
 - (NSPoint)convertPointToScreen:(NSPoint)point;
 - (NSPoint)convertPointFromScreen:(NSPoint)point;
 
-- (NSBitmapImageRep *)bitmapImageRepCachingDisplayInRect:(NSRect)rect;
+- (NSBitmapImageRep *)bitmapImageRepCachingDisplay;
 
 - (void)activateConstraintsToSuperview;
 

Modified: trunk/NSView_SKExtensions.m
===================================================================
--- trunk/NSView_SKExtensions.m 2024-03-24 17:46:19 UTC (rev 14135)
+++ trunk/NSView_SKExtensions.m 2024-03-24 17:51:16 UTC (rev 14136)
@@ -93,7 +93,8 @@
     return [self convertPoint:[[self window] 
convertRectFromScreen:rect].origin fromView:nil];
 }
 
-- (NSBitmapImageRep *)bitmapImageRepCachingDisplayInRect:(NSRect)rect {
+- (NSBitmapImageRep *)bitmapImageRepCachingDisplay {
+    NSRect rect = [self bounds];
     NSBitmapImageRep *imageRep = [self 
bitmapImageRepForCachingDisplayInRect:rect];
     [self cacheDisplayInRect:rect toBitmapImageRep:imageRep];
     return imageRep;

Modified: trunk/SKBasePDFView.m
===================================================================
--- trunk/SKBasePDFView.m       2024-03-24 17:46:19 UTC (rev 14135)
+++ trunk/SKBasePDFView.m       2024-03-24 17:51:16 UTC (rev 14136)
@@ -392,9 +392,10 @@
     }
 }
 
-- (NSBitmapImageRep *)bitmapImageRepCachingDisplayInRect:(NSRect)rect {
+- (NSBitmapImageRep *)bitmapImageRepCachingDisplay {
     // draw our own bitmap, because macOS 12 does it wrong
     // ignore background and page shadows because
+    NSRect rect = [self bounds];
     NSBitmapImageRep *imageRep = [self 
bitmapImageRepForCachingDisplayInRect:rect];
     CGContextRef context = [[NSGraphicsContext 
graphicsContextWithBitmapImageRep:imageRep] CGContext];
     if (NSEqualPoints(rect.origin, NSZeroPoint) == NO)

Modified: trunk/SKLineWell.m
===================================================================
--- trunk/SKLineWell.m  2024-03-24 17:46:19 UTC (rev 14135)
+++ trunk/SKLineWell.m  2024-03-24 17:51:16 UTC (rev 14136)
@@ -290,7 +290,7 @@
     BOOL wasActive = lwFlags.active;
     
     lwFlags.active = 0;
-    imageRep = [self bitmapImageRepCachingDisplayInRect:bounds];
+    imageRep = [self bitmapImageRepCachingDisplay];
     lwFlags.active = wasActive;
     
     NSGraphicsContext *context = [NSGraphicsContext 
graphicsContextWithBitmapImageRep:imageRep];

Modified: trunk/SKSnapshotWindowController.m
===================================================================
--- trunk/SKSnapshotWindowController.m  2024-03-24 17:46:19 UTC (rev 14135)
+++ trunk/SKSnapshotWindowController.m  2024-03-24 17:51:16 UTC (rev 14136)
@@ -605,9 +605,8 @@
     if (hadWindow) {
         windowImage = [(SKSnapshotWindow *)window windowImage];
     } else {
-        NSView *view = [[window contentView] superview];
         windowImage = [[NSImage alloc] initWithSize:[window frame].size];
-        [windowImage addRepresentation:[view 
bitmapImageRepCachingDisplayInRect:[view bounds]]];
+        [windowImage addRepresentation:[[[window contentView] superview] 
bitmapImageRepCachingDisplay]];
     }
     
     SKAnimatedBorderlessWindow *miniaturizeWindow = 
[[SKAnimatedBorderlessWindow alloc] initWithContentRect:startRect];

Modified: trunk/SKThumbnailView.m
===================================================================
--- trunk/SKThumbnailView.m     2024-03-24 17:46:19 UTC (rev 14135)
+++ trunk/SKThumbnailView.m     2024-03-24 17:51:16 UTC (rev 14136)
@@ -426,9 +426,8 @@
 - (NSImage *)draggingImage {
     if ([imageView image] == nil)
         return nil;
-    NSRect rect = [imageView bounds];
-    NSImage *dragImage = [[NSImage alloc] initWithSize:rect.size];
-    [dragImage addRepresentation:[imageView 
bitmapImageRepCachingDisplayInRect:rect]];
+    NSImage *dragImage = [[NSImage alloc] initWithSize:[imageView 
bounds].size];
+    [dragImage addRepresentation:[imageView bitmapImageRepCachingDisplay]];
     return dragImage;
 }
 

Modified: trunk/SKTransitionController.m
===================================================================
--- trunk/SKTransitionController.m      2024-03-24 17:46:19 UTC (rev 14135)
+++ trunk/SKTransitionController.m      2024-03-24 17:51:16 UTC (rev 14136)
@@ -357,7 +357,7 @@
 
 - (CIImage *)currentImageForRect:(NSRect)rect scale:(CGFloat *)scalePtr {
     NSRect bounds = [view bounds];
-    NSBitmapImageRep *contentBitmap = [view 
bitmapImageRepCachingDisplayInRect:bounds];
+    NSBitmapImageRep *contentBitmap = [view bitmapImageRepCachingDisplay];
     CIImage *tmpImage = [[CIImage alloc] initWithBitmapImageRep:contentBitmap];
     CGFloat scale = CGRectGetWidth([tmpImage extent]) / NSWidth(bounds);
     CIImage *image = [tmpImage 
imageByCroppingToRect:CGRectIntegral(scaleRect(NSIntersectionRect(rect, 
bounds), scale))];

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