|
From: <ho...@us...> - 2025-11-04 16:46:18
|
Revision: 15761
http://sourceforge.net/p/skim-app/code/15761
Author: hofman
Date: 2025-11-04 16:46:16 +0000 (Tue, 04 Nov 2025)
Log Message:
-----------
override drawInteriorWithFrame instead of drawWithFrame for level indicator
Modified Paths:
--------------
trunk/SKLevelIndicator.m
Modified: trunk/SKLevelIndicator.m
===================================================================
--- trunk/SKLevelIndicator.m 2025-11-04 15:35:22 UTC (rev 15760)
+++ trunk/SKLevelIndicator.m 2025-11-04 16:46:16 UTC (rev 15761)
@@ -55,14 +55,14 @@
@implementation SKLevelIndicatorCell
-#define EDGE_HEIGHT 4.0
+#define EDGE_HEIGHT 3.0
-- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
+- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
CGFloat cellHeight = [self cellSize].height;
if (fabs(NSHeight(cellFrame) - cellHeight) <= 0.0) {
[NSGraphicsContext saveGraphicsState];
[[NSBezierPath bezierPathWithRect:cellFrame] addClip];
- [super drawWithFrame:cellFrame inView:controlView];
+ [super drawInteriorWithFrame:cellFrame inView:controlView];
[NSGraphicsContext restoreGraphicsState];
} else if (NSHeight(cellFrame) <= 2.0 * (cellHeight - EDGE_HEIGHT)) {
NSRect topFrame, bottomFrame, frame = cellFrame;
@@ -70,12 +70,12 @@
frame.size.height = cellHeight;
[NSGraphicsContext saveGraphicsState];
[[NSBezierPath bezierPathWithRect:topFrame] addClip];
- [super drawWithFrame:frame inView:controlView];
+ [super drawInteriorWithFrame:frame inView:controlView];
[NSGraphicsContext restoreGraphicsState];
[NSGraphicsContext saveGraphicsState];
[[NSBezierPath bezierPathWithRect:bottomFrame] addClip];
frame.origin.y = NSMaxY(bottomFrame) - cellHeight;
- [super drawWithFrame:frame inView:controlView];
+ [super drawInteriorWithFrame:frame inView:controlView];
[NSGraphicsContext restoreGraphicsState];
} else {
NSRect topFrame, bottomFrame, restFrame, frame = cellFrame, midFrame;
@@ -84,7 +84,7 @@
frame.size.height = cellHeight;
[NSGraphicsContext saveGraphicsState];
[[NSBezierPath bezierPathWithRect:topFrame] addClip];
- [super drawWithFrame:frame inView:controlView];
+ [super drawInteriorWithFrame:frame inView:controlView];
[NSGraphicsContext restoreGraphicsState];
do {
NSDivideRect(restFrame, &midFrame, &restFrame, fmin(cellHeight - 2.0 * EDGE_HEIGHT, NSHeight(restFrame)), NSMinYEdge);
@@ -91,13 +91,13 @@
[NSGraphicsContext saveGraphicsState];
[[NSBezierPath bezierPathWithRect:midFrame] addClip];
frame.origin.y = NSMinY(midFrame) - EDGE_HEIGHT;
- [super drawWithFrame:frame inView:controlView];
+ [super drawInteriorWithFrame:frame inView:controlView];
[NSGraphicsContext restoreGraphicsState];
} while (NSHeight(restFrame) > 0.0);
frame.origin.y = NSMaxY(bottomFrame) - cellHeight;
[NSGraphicsContext saveGraphicsState];
[[NSBezierPath bezierPathWithRect:bottomFrame] addClip];
- [super drawWithFrame:frame inView:controlView];
+ [super drawInteriorWithFrame:frame inView:controlView];
[NSGraphicsContext restoreGraphicsState];
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|