Revision: 12411
          http://sourceforge.net/p/skim-app/code/12411
Author:   hofman
Date:     2021-09-18 09:29:11 +0000 (Sat, 18 Sep 2021)
Log Message:
-----------
Use different calculation so we don't have to substract from an unsigned integer

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

Modified: trunk/SKColorSwatch.m
===================================================================
--- trunk/SKColorSwatch.m       2021-09-18 09:24:17 UTC (rev 12410)
+++ trunk/SKColorSwatch.m       2021-09-18 09:29:11 UTC (rev 12411)
@@ -213,7 +213,7 @@
 }
 
 - (NSSize)contentSizeForNumberOfColors:(NSUInteger)count {
-    return NSMakeSize(bezelHeight + ((NSInteger)count - 1) * [self 
distanceBetweenColors], bezelHeight);
+    return NSMakeSize(COLOR_INSET + count * [self distanceBetweenColors], 
bezelHeight);
 }
 
 - (NSRect)frameForColorAtIndex:(NSInteger)anIndex {
@@ -635,7 +635,7 @@
 - (void)removeColorAtIndex:(NSInteger)i {
     if (i >= 0 && i < (NSInteger)[colors count] && [colors count] > 1) {
         [self deactivate];
-        NSSize size = [self sizeForNumberOfColors:(NSInteger)[colors count] - 
1];
+        NSSize size = [self sizeForNumberOfColors:[colors count] - 1];
         [self noteFocusRingMaskChanged];
         [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){
                 [self animateItemViewsCollapsing:i frameSize:size];

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