Revision: 14451
          http://sourceforge.net/p/skim-app/code/14451
Author:   hofman
Date:     2024-09-01 22:49:21 +0000 (Sun, 01 Sep 2024)
Log Message:
-----------
show magnification in status bar with sufficient precision

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

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2024-09-01 22:39:06 UTC (rev 14450)
+++ trunk/SKMainWindowController.m      2024-09-01 22:49:21 UTC (rev 14451)
@@ -688,8 +688,13 @@
         } else {
             message = [NSString stringWithFormat:@"%.1f %C %.1f @ (%.1f, %.1f) 
%@", NSWidth(rect), MULTIPLICATION_SIGN_CHARACTER, NSHeight(rect), 
NSMinX(rect), NSMinY(rect), NSLocalizedString(@"pt", @"size unit")];
         }
-    } else if (magnification > 0.0001) {
-        message = [NSString stringWithFormat:@"%.2f %C", magnification, 
MULTIPLICATION_SIGN_CHARACTER];
+    } else if (magnification > 0.001) {
+        if (floor(magnification) >= magnification)
+            message = [NSString stringWithFormat:@"%.0f %C", magnification, 
MULTIPLICATION_SIGN_CHARACTER];
+        else if (floor(10.0 * magnification) >= 10.0 * magnification)
+            message = [NSString stringWithFormat:@"%.1f %C", magnification, 
MULTIPLICATION_SIGN_CHARACTER];
+        else
+            message = [NSString stringWithFormat:@"%.2f %C", magnification, 
MULTIPLICATION_SIGN_CHARACTER];
     } else {
         message = @"";
     }

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