Revision: 12521
          http://sourceforge.net/p/skim-app/code/12521
Author:   hofman
Date:     2021-11-04 17:53:21 +0000 (Thu, 04 Nov 2021)
Log Message:
-----------
Don't add clip for full cell when we add clips for partial cells

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

Modified: trunk/SKLevelIndicatorCell.m
===================================================================
--- trunk/SKLevelIndicatorCell.m        2021-11-04 16:36:52 UTC (rev 12520)
+++ trunk/SKLevelIndicatorCell.m        2021-11-04 17:53:21 UTC (rev 12521)
@@ -47,11 +47,12 @@
     BOOL drawDiscreteContinuous = ([self levelIndicatorStyle] == 
NSDiscreteCapacityLevelIndicatorStyle) && (NSWidth(cellFrame) + 1.0 < 3.0 * 
[self maxValue]);
     if (drawDiscreteContinuous)
         [self setLevelIndicatorStyle:NSContinuousCapacityLevelIndicatorStyle];
-    [NSGraphicsContext saveGraphicsState];
-    [[NSBezierPath bezierPathWithRect:cellFrame] addClip];
     CGFloat cellHeight = [self cellSize].height;
     if (fabs(NSHeight(cellFrame) - cellHeight) <= 0.0) {
+        [NSGraphicsContext saveGraphicsState];
+        [[NSBezierPath bezierPathWithRect:cellFrame] addClip];
         [super drawWithFrame:cellFrame inView:controlView];
+        [NSGraphicsContext restoreGraphicsState];
     } else if (RUNNING_BEFORE(10_13)) {
         NSRect frame = SKCenterRectVertically(cellFrame, cellHeight, 0.0, 
[controlView isFlipped]);
         [NSGraphicsContext saveGraphicsState];
@@ -94,7 +95,6 @@
         [super drawWithFrame:frame inView:controlView];
         [NSGraphicsContext restoreGraphicsState];
     }
-    [NSGraphicsContext restoreGraphicsState];
     if (drawDiscreteContinuous)
         [self setLevelIndicatorStyle:NSDiscreteCapacityLevelIndicatorStyle];
 }

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