Revision: 15169
          http://sourceforge.net/p/skim-app/code/15169
Author:   hofman
Date:     2025-05-08 16:14:28 +0000 (Thu, 08 May 2025)
Log Message:
-----------
macro instead of function

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

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2025-05-08 16:11:24 UTC (rev 15168)
+++ trunk/SKMainWindowController.m      2025-05-08 16:14:28 UTC (rev 15169)
@@ -115,6 +115,7 @@
 #define LARGE_SIZE 128.0
 #define HUGE_SIZE  256.0
 #define FUDGE_SIZE 0.1
+#define CACHE_SIZE_FOR_SIZE(size) (size < TINY_SIZE + FUDGE_SIZE) ? TINY_SIZE 
: (size < SMALL_SIZE + FUDGE_SIZE) ? SMALL_SIZE : (size < LARGE_SIZE + 
FUDGE_SIZE) ? LARGE_SIZE : HUGE_SIZE
 
 #define MAX_PAGE_COLUMN_WIDTH   80.0
 #define MAX_PAGE_COLUMN_WIDTH_1 50.0
@@ -2975,14 +2976,10 @@
     mwcFlags.updatingThumbnailSelection = 0;
 }
 
-static inline CGFloat cacheSizeForSize(CGFloat size) {
-    return (size < TINY_SIZE + FUDGE_SIZE) ? TINY_SIZE : (size < SMALL_SIZE + 
FUDGE_SIZE) ? SMALL_SIZE : (size < LARGE_SIZE + FUDGE_SIZE) ? LARGE_SIZE : 
HUGE_SIZE;
-}
-
 - (void)resetThumbnailSizeIfNeeded {
     thumbnailSize = round([[NSUserDefaults standardUserDefaults] 
floatForKey:SKThumbnailSizeKey]);
 
-    CGFloat cacheSize = cacheSizeForSize(thumbnailSize);
+    CGFloat cacheSize = CACHE_SIZE_FOR_SIZE(thumbnailSize);
     
     if (fabs(cacheSize - thumbnailCacheSize) > FUDGE_SIZE) {
         thumbnailCacheSize = cacheSize;
@@ -3060,7 +3057,7 @@
 
 - (void)resetSnapshotSizeIfNeeded {
     snapshotThumbnailSize = round([[NSUserDefaults standardUserDefaults] 
floatForKey:SKSnapshotThumbnailSizeKey]);
-    CGFloat snapshotSize = cacheSizeForSize(snapshotThumbnailSize);
+    CGFloat snapshotSize = CACHE_SIZE_FOR_SIZE(snapshotThumbnailSize);
     
     if (fabs(snapshotSize - snapshotCacheSize) > FUDGE_SIZE) {
         snapshotCacheSize = snapshotSize;

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