Revision: 15023
http://sourceforge.net/p/skim-app/code/15023
Author: hofman
Date: 2025-03-25 22:56:08 +0000 (Tue, 25 Mar 2025)
Log Message:
-----------
use macro
Modified Paths:
--------------
trunk/SKColorSwatch.m
Modified: trunk/SKColorSwatch.m
===================================================================
--- trunk/SKColorSwatch.m 2025-03-25 18:35:22 UTC (rev 15022)
+++ trunk/SKColorSwatch.m 2025-03-25 22:56:08 UTC (rev 15023)
@@ -243,7 +243,7 @@
NSInteger i = anIndex;
if (collapsedIndex != -1 && anIndex > collapsedIndex)
i--;
- NSRect rect = NSInsetRect([self frameForColorAtIndex:i], -2.0, -2.0);
+ NSRect rect = NSInsetRect([self frameForColorAtIndex:i], -COLOR_INSET,
-COLOR_INSET);
if (collapsedIndex == anIndex)
rect.size.width -= DISTANCE_BETWEEN_COLORS;
return rect;
@@ -991,7 +991,7 @@
NSRect rect = [self bounds];
if (NSWidth(rect) < 5.0)
return;
- rect = NSInsetRect(rect, 2.0, 2.0);
+ rect = NSInsetRect(rect, COLOR_INSET, COLOR_INSET);
CGFloat r = swatchRadius([(SKColorSwatch *)[self superview] controlSize]);
BOOL disabled = NO;
if (@available(macOS 10.14, *))
@@ -1049,9 +1049,9 @@
[path lineToPoint:NSMakePoint(NSMaxX(rect) + 0.5, NSMaxY(rect) +
1.0)];
}
[path setLineWidth:3.0];
- if ((dropLocation == SKColorSwatchDropBefore && NSMinX([[self
superview] bounds]) + 2.0 >= NSMinX([self frame])) ||
- (dropLocation == SKColorSwatchDropAfter && NSMaxX([[self
superview] bounds]) - 2.0 <= NSMaxX([self frame])))
- [[NSBezierPath bezierPathWithRoundedRect:NSInsetRect(rect, -2.0,
-2.0) xRadius:r + 2.0 yRadius:r + 2.0] addClip];
+ if ((dropLocation == SKColorSwatchDropBefore && NSMinX([[self
superview] bounds]) + COLOR_INSET >= NSMinX([self frame])) ||
+ (dropLocation == SKColorSwatchDropAfter && NSMaxX([[self
superview] bounds]) - COLOR_INSET <= NSMaxX([self frame])))
+ [[NSBezierPath bezierPathWithRoundedRect:NSInsetRect(rect,
-COLOR_INSET, -COLOR_INSET) xRadius:r + COLOR_INSET yRadius:r + COLOR_INSET]
addClip];
[path stroke];
}
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