Revision: 13171 http://sourceforge.net/p/skim-app/code/13171 Author: hofman Date: 2022-11-13 16:50:06 +0000 (Sun, 13 Nov 2022) Log Message: ----------- Draw both resize handles for line note from one function so we don't need to set the context parameters twice
Modified Paths: -------------- trunk/NSGraphics_SKExtensions.h trunk/NSGraphics_SKExtensions.m trunk/PDFAnnotationLine_SKExtensions.m Modified: trunk/NSGraphics_SKExtensions.h =================================================================== --- trunk/NSGraphics_SKExtensions.h 2022-11-13 16:39:28 UTC (rev 13170) +++ trunk/NSGraphics_SKExtensions.h 2022-11-13 16:50:06 UTC (rev 13171) @@ -48,8 +48,8 @@ #pragma mark - -extern void SKDrawResizeHandle(CGContextRef context, NSPoint point, CGFloat lineWidth, BOOL active); extern void SKDrawResizeHandles(CGContextRef context, NSRect rect, CGFloat lineWidth, BOOL connected, BOOL active); +extern void SKDrawResizeHandlePair(CGContextRef context, NSPoint point1, NSPoint point2, CGFloat lineWidth, BOOL active); #pragma mark - Modified: trunk/NSGraphics_SKExtensions.m =================================================================== --- trunk/NSGraphics_SKExtensions.m 2022-11-13 16:39:28 UTC (rev 13170) +++ trunk/NSGraphics_SKExtensions.m 2022-11-13 16:50:06 UTC (rev 13171) @@ -134,13 +134,6 @@ CGContextStrokeEllipseInRect(context, rect); } -void SKDrawResizeHandle(CGContextRef context, NSPoint point, CGFloat lineWidth, BOOL active) -{ - SKSetColorsForResizeHandle(context, active); - CGContextSetLineWidth(context, lineWidth); - SKFillStrokeResizeHandle(context, point, lineWidth); -} - void SKDrawResizeHandles(CGContextRef context, NSRect rect, CGFloat lineWidth, BOOL connected, BOOL active) { SKSetColorsForResizeHandle(context, active); @@ -185,6 +178,14 @@ } } +void SKDrawResizeHandlePair(CGContextRef context, NSPoint point1, NSPoint point2, CGFloat lineWidth, BOOL active) +{ + SKSetColorsForResizeHandle(context, active); + CGContextSetLineWidth(context, lineWidth); + SKFillStrokeResizeHandle(context, point1, lineWidth); + SKFillStrokeResizeHandle(context, point2, lineWidth); +} + #pragma mark - void SKDrawTextFieldBezel(NSRect rect, NSView *controlView) { Modified: trunk/PDFAnnotationLine_SKExtensions.m =================================================================== --- trunk/PDFAnnotationLine_SKExtensions.m 2022-11-13 16:39:28 UTC (rev 13170) +++ trunk/PDFAnnotationLine_SKExtensions.m 2022-11-13 16:50:06 UTC (rev 13171) @@ -270,12 +270,9 @@ if (NSIsEmptyRect([self bounds])) return; NSPoint origin = [self bounds].origin; - NSPoint point = SKAddPoints(origin, [self startPoint]); CGFloat delta = [pdfView unitWidthOnPage:[self page]]; BOOL active = [pdfView drawsActiveSelections]; - SKDrawResizeHandle(context, point, delta, active); - point = SKAddPoints(origin, [self endPoint]); - SKDrawResizeHandle(context, point, delta, active); + SKDrawResizeHandlePair(context, SKAddPoints(origin, [self startPoint]), SKAddPoints(origin, [self endPoint]), delta, active); } - (NSString *)colorDefaultKey { return SKLineNoteColorKey; } 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