You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
(23) |
Apr
(254) |
May
(252) |
Jun
(209) |
Jul
(198) |
Aug
(192) |
Sep
(207) |
Oct
(120) |
Nov
(179) |
Dec
(52) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(48) |
Feb
(69) |
Mar
(129) |
Apr
(250) |
May
(113) |
Jun
(177) |
Jul
(228) |
Aug
(155) |
Sep
(218) |
Oct
(185) |
Nov
(109) |
Dec
(88) |
2009 |
Jan
(83) |
Feb
(39) |
Mar
(70) |
Apr
(47) |
May
(48) |
Jun
(67) |
Jul
(61) |
Aug
(97) |
Sep
(221) |
Oct
(141) |
Nov
(70) |
Dec
(61) |
2010 |
Jan
(45) |
Feb
(76) |
Mar
(178) |
Apr
(106) |
May
(57) |
Jun
(32) |
Jul
(64) |
Aug
(98) |
Sep
(96) |
Oct
(19) |
Nov
(34) |
Dec
(117) |
2011 |
Jan
(55) |
Feb
(48) |
Mar
(64) |
Apr
(21) |
May
(39) |
Jun
(53) |
Jul
(99) |
Aug
(56) |
Sep
(39) |
Oct
(26) |
Nov
(19) |
Dec
(69) |
2012 |
Jan
(17) |
Feb
(40) |
Mar
(17) |
Apr
|
May
(2) |
Jun
(8) |
Jul
(2) |
Aug
(10) |
Sep
(10) |
Oct
(38) |
Nov
(48) |
Dec
(70) |
2013 |
Jan
(43) |
Feb
(47) |
Mar
(39) |
Apr
(37) |
May
(25) |
Jun
(6) |
Jul
(20) |
Aug
(49) |
Sep
(33) |
Oct
(34) |
Nov
(75) |
Dec
(6) |
2014 |
Jan
(32) |
Feb
(10) |
Mar
(17) |
Apr
|
May
|
Jun
(26) |
Jul
(5) |
Aug
|
Sep
(4) |
Oct
(23) |
Nov
(80) |
Dec
(48) |
2015 |
Jan
(80) |
Feb
(50) |
Mar
(58) |
Apr
(20) |
May
(11) |
Jun
(16) |
Jul
(24) |
Aug
(27) |
Sep
(56) |
Oct
(30) |
Nov
(16) |
Dec
(6) |
2016 |
Jan
(31) |
Feb
(14) |
Mar
(23) |
Apr
(17) |
May
(40) |
Jun
(12) |
Jul
(17) |
Aug
(9) |
Sep
(32) |
Oct
(36) |
Nov
(23) |
Dec
(9) |
2017 |
Jan
(37) |
Feb
(23) |
Mar
(65) |
Apr
(22) |
May
(6) |
Jun
(3) |
Jul
|
Aug
|
Sep
(3) |
Oct
(22) |
Nov
(63) |
Dec
(71) |
2018 |
Jan
(83) |
Feb
(21) |
Mar
(35) |
Apr
(44) |
May
(14) |
Jun
(12) |
Jul
(8) |
Aug
(18) |
Sep
(10) |
Oct
(145) |
Nov
(144) |
Dec
(76) |
2019 |
Jan
(18) |
Feb
(28) |
Mar
(5) |
Apr
(208) |
May
(291) |
Jun
(158) |
Jul
(27) |
Aug
(8) |
Sep
(10) |
Oct
(83) |
Nov
(41) |
Dec
(31) |
2020 |
Jan
(16) |
Feb
(46) |
Mar
(100) |
Apr
(78) |
May
(69) |
Jun
(71) |
Jul
(28) |
Aug
(131) |
Sep
(176) |
Oct
(89) |
Nov
(147) |
Dec
(19) |
2021 |
Jan
(19) |
Feb
(25) |
Mar
(91) |
Apr
(98) |
May
(14) |
Jun
(44) |
Jul
(8) |
Aug
(3) |
Sep
(38) |
Oct
(57) |
Nov
(97) |
Dec
(74) |
2022 |
Jan
(89) |
Feb
(47) |
Mar
(15) |
Apr
(50) |
May
(54) |
Jun
(56) |
Jul
(80) |
Aug
(12) |
Sep
(11) |
Oct
(60) |
Nov
(48) |
Dec
(4) |
2023 |
Jan
(75) |
Feb
(49) |
Mar
(84) |
Apr
(24) |
May
(13) |
Jun
(74) |
Jul
(32) |
Aug
(66) |
Sep
(50) |
Oct
(38) |
Nov
(105) |
Dec
(181) |
2024 |
Jan
(21) |
Feb
(49) |
Mar
(77) |
Apr
(84) |
May
(20) |
Jun
(71) |
Jul
(53) |
Aug
(33) |
Sep
(54) |
Oct
(124) |
Nov
(151) |
Dec
(73) |
2025 |
Jan
(61) |
Feb
(17) |
Mar
(136) |
Apr
(72) |
May
(200) |
Jun
(238) |
Jul
(91) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ho...@us...> - 2025-07-11 15:49:38
|
Revision: 15642 http://sourceforge.net/p/skim-app/code/15642 Author: hofman Date: 2025-07-11 15:49:35 +0000 (Fri, 11 Jul 2025) Log Message: ----------- Let pdfview set the frame for the text note editor. Declare pdfview as NSResponder conforming to delegate protocol. Modified Paths: -------------- trunk/SKPDFView.m trunk/SKTextNoteEditor.h trunk/SKTextNoteEditor.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2025-07-11 14:51:46 UTC (rev 15641) +++ trunk/SKPDFView.m 2025-07-11 15:49:35 UTC (rev 15642) @@ -188,7 +188,7 @@ - (void)enableSwipeGestures:(BOOL)flag; @end -@interface SKPDFView () <SKReadingBarDelegate, SKLayerDelegate> +@interface SKPDFView () <SKReadingBarDelegate, SKLayerDelegate, SKTextNoteEditorDelegate> @property (strong) SKReadingBar *readingBar; @property (strong) SKSyncDot *syncDot; @end @@ -415,7 +415,7 @@ [self resetPDFToolTipRects]; if (editor) { if ([self isPageAtIndexDisplayed:[currentAnnotation pageIndex]]) - [editor updateFrame]; + [self textNoteEditorSetFrame:editor]; else [self commitEditing]; } @@ -2774,7 +2774,7 @@ if ([self isEditingAnnotation:currentAnnotation]) return; - editor = [[SKTextNoteEditor alloc] initWithPDFView:self annotation:currentAnnotation]; + editor = [[SKTextNoteEditor alloc] initWithAnnotation:currentAnnotation delegate:self]; [[self documentView] addSubview:editor]; [editor startEditingWithEvent:theEvent]; @@ -2781,6 +2781,13 @@ [self updatedAnnotation:currentAnnotation]; } +- (void)textNoteEditorSetFrame:(SKTextNoteEditor *)textNoteEditor { + NSRect frame = [self convertRect:[currentAnnotation bounds] fromPage:[currentAnnotation page]]; + frame = [self backingAlignedRect:frame options:NSAlignAllEdgesNearest]; + frame = [self convertRect:frame toView:[self documentView]]; + [editor setFrame:frame]; +} + - (void)textNoteEditorDidBeginEditing:(SKTextNoteEditor *)textNoteEditor { if ([[self delegate] respondsToSelector:@selector(PDFViewDidBeginEditing:)]) [[self delegate] PDFViewDidBeginEditing:self]; @@ -3152,7 +3159,7 @@ [self resetPDFToolTipRects]; } else if ([self isEditingAnnotation:annotation]) { if ([self isPageAtIndexDisplayed:[annotation pageIndex]]) - [editor updateFrame]; + [self textNoteEditorSetFrame:editor]; else [self commitEditing]; } @@ -3193,7 +3200,7 @@ - (void)handleScaleChangedNotification:(NSNotification *)notification { [self resetPDFToolTipRects]; [self updatePacer]; - [editor updateFrame]; + [self textNoteEditorSetFrame:editor]; } - (void)handleUpdateTrackingAreasNotification:(NSNotification *)notification { Modified: trunk/SKTextNoteEditor.h =================================================================== --- trunk/SKTextNoteEditor.h 2025-07-11 14:51:46 UTC (rev 15641) +++ trunk/SKTextNoteEditor.h 2025-07-11 15:49:35 UTC (rev 15642) @@ -41,24 +41,26 @@ NS_ASSUME_NONNULL_BEGIN +@protocol SKTextNoteEditorDelegate; + @interface SKTextNoteEditor : NSView <NSTextViewDelegate> { NSTextView *textView; - __weak PDFView *pdfView; + __weak NSResponder<SKTextNoteEditorDelegate> *delegate; PDFAnnotation *annotation; NSUndoManager *undoManager; } -- (instancetype)initWithPDFView:(PDFView *)aPDFView annotation:(PDFAnnotation *)anAnnotation; +- (instancetype)initWithAnnotation:(PDFAnnotation *)anAnnotation delegate:(NSResponder<SKTextNoteEditorDelegate> *)aDelegate; @property (nonatomic, nullable, weak, readonly) NSString *currentString; - (void)startEditingWithEvent:(nullable NSEvent *)event; - (void)endEditingWithCommit:(BOOL)commit; -- (void)updateFrame; @end -@interface PDFView (SKTextNoteEditor) +@protocol SKTextNoteEditorDelegate <NSObject>; +- (void)textNoteEditorSetFrame:(SKTextNoteEditor *)textNoteEditor; - (void)textNoteEditorDidBeginEditing:(SKTextNoteEditor *)textNoteEditor; - (void)textNoteEditorDidEndEditing:(SKTextNoteEditor *)textNoteEditor; @end Modified: trunk/SKTextNoteEditor.m =================================================================== --- trunk/SKTextNoteEditor.m 2025-07-11 14:51:46 UTC (rev 15641) +++ trunk/SKTextNoteEditor.m 2025-07-11 15:49:35 UTC (rev 15642) @@ -37,9 +37,7 @@ */ #import "SKTextNoteEditor.h" -#import "PDFView_SKExtensions.h" #import "PDFAnnotation_SKExtensions.h" -#import "NSView_SKExtensions.h" #import "NSEvent_SKExtensions.h" #import "SKChainedUndoManager.h" #import "SKStringConstants.h" @@ -60,10 +58,10 @@ return @[SKNPDFAnnotationBoundsKey, SKNPDFAnnotationFontKey, SKNPDFAnnotationFontColorKey, SKNPDFAnnotationAlignmentKey, SKNPDFAnnotationColorKey, SKNPDFAnnotationBorderKey, SKNPDFAnnotationStringKey]; } -- (instancetype)initWithPDFView:(PDFView *)aPDFView annotation:(PDFAnnotation *)anAnnotation { +- (instancetype)initWithAnnotation:(PDFAnnotation *)anAnnotation delegate:(NSResponder<SKTextNoteEditorDelegate> *)aDelegate { self = [super initWithFrame:[annotation bounds]]; if (self) { - pdfView = aPDFView; + delegate = aDelegate; annotation = anAnnotation; for (NSString *key in [[self class] keysToObserve]) @@ -89,12 +87,6 @@ return [textView string] ?: [annotation string]; } -- (void)updateFrame { - NSRect frame = [pdfView backingAlignedRect:[pdfView convertRect:[annotation bounds] fromPage:[annotation page]] options:NSAlignAllEdgesNearest]; - frame = [pdfView convertRect:frame toView:[self superview]]; - [self setFrame:frame]; -} - - (void)updateParagraphStyle { NSFont *font = [annotation font]; NSMutableParagraphStyle *parStyle = [[NSMutableParagraphStyle alloc] init]; @@ -165,24 +157,24 @@ [textView setDelegate:nil]; if ([self superview]) { - BOOL wasFirstResponder = (textView && [[pdfView window] firstResponder] == textView); + NSWindow *window = [self window]; + BOOL wasFirstResponder = (textView && [window firstResponder] == textView); [self removeFromSuperview]; - [[pdfView window] recalculateKeyViewLoop]; + [window recalculateKeyViewLoop]; if (wasFirstResponder) - [[pdfView window] makeFirstResponder:pdfView]; + [window makeFirstResponder:delegate]; } - PDFView *thePdfView = pdfView; - pdfView = nil; + NSResponder<SKTextNoteEditorDelegate> *theDelegate = delegate; + delegate = nil; - if ([thePdfView respondsToSelector:@selector(textNoteEditorDidEndEditing:)]) - [thePdfView textNoteEditorDidEndEditing:self]; + [theDelegate textNoteEditorDidEndEditing:self]; } - (void)startEditingWithEvent:(NSEvent *)event { - [self updateFrame]; + [delegate textNoteEditorSetFrame:self]; [self setUpTextView]; - [[pdfView window] recalculateKeyViewLoop]; + [[self window] recalculateKeyViewLoop]; [textView scrollPoint:NSZeroPoint]; [annotation setShouldDisplay:NO]; if (event) { @@ -207,8 +199,7 @@ } - (void)textDidBeginEditing:(NSNotification *)notification { - if ([pdfView respondsToSelector:@selector(textNoteEditorDidBeginEditing:)]) - [pdfView textNoteEditorDidBeginEditing:self]; + [delegate textNoteEditorDidBeginEditing:self]; } - (void)textDidEndEditing:(NSNotification *)notification { @@ -217,7 +208,7 @@ - (NSUndoManager *)undoManagerForTextView:(NSTextView *)view { if (undoManager == nil) - undoManager = [[SKChainedUndoManager alloc] initWithNextUndoManager:[pdfView undoManager]]; + undoManager = [[SKChainedUndoManager alloc] initWithNextUndoManager:[delegate undoManager]]; return undoManager; } @@ -224,7 +215,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if (context == &SKPDFAnnotationPropertiesObservationContext) { if ([keyPath isEqualToString:SKNPDFAnnotationBoundsKey]) { - [self updateFrame]; + [delegate textNoteEditorSetFrame:self]; } else if ([keyPath isEqualToString:SKNPDFAnnotationFontKey]) { [textView setFont:[annotation font]]; [self updateParagraphStyle]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-11 14:51:49
|
Revision: 15641 http://sourceforge.net/p/skim-app/code/15641 Author: hofman Date: 2025-07-11 14:51:46 +0000 (Fri, 11 Jul 2025) Log Message: ----------- let pdfview add text note editor to documentView Modified Paths: -------------- trunk/SKPDFView.m trunk/SKTextNoteEditor.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2025-07-11 14:43:33 UTC (rev 15640) +++ trunk/SKPDFView.m 2025-07-11 14:51:46 UTC (rev 15641) @@ -2775,6 +2775,7 @@ return; editor = [[SKTextNoteEditor alloc] initWithPDFView:self annotation:currentAnnotation]; + [[self documentView] addSubview:editor]; [editor startEditingWithEvent:theEvent]; [self updatedAnnotation:currentAnnotation]; Modified: trunk/SKTextNoteEditor.m =================================================================== --- trunk/SKTextNoteEditor.m 2025-07-11 14:43:33 UTC (rev 15640) +++ trunk/SKTextNoteEditor.m 2025-07-11 14:51:46 UTC (rev 15641) @@ -91,7 +91,7 @@ - (void)updateFrame { NSRect frame = [pdfView backingAlignedRect:[pdfView convertRect:[annotation bounds] fromPage:[annotation page]] options:NSAlignAllEdgesNearest]; - frame = [pdfView convertRect:frame toView:[pdfView documentView]]; + frame = [pdfView convertRect:frame toView:[self superview]]; [self setFrame:frame]; } @@ -180,9 +180,8 @@ } - (void)startEditingWithEvent:(NSEvent *)event { + [self updateFrame]; [self setUpTextView]; - [self updateFrame]; - [[pdfView documentView] addSubview:self]; [[pdfView window] recalculateKeyViewLoop]; [textView scrollPoint:NSZeroPoint]; [annotation setShouldDisplay:NO]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-11 14:43:36
|
Revision: 15640 http://sourceforge.net/p/skim-app/code/15640 Author: hofman Date: 2025-07-11 14:43:33 +0000 (Fri, 11 Jul 2025) Log Message: ----------- resize text note editor or end editing from pdfvieww Modified Paths: -------------- trunk/SKPDFView.m trunk/SKTextNoteEditor.h trunk/SKTextNoteEditor.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2025-07-11 14:28:15 UTC (rev 15639) +++ trunk/SKPDFView.m 2025-07-11 14:43:33 UTC (rev 15640) @@ -413,7 +413,12 @@ - (void)layoutDocumentView { [super layoutDocumentView]; [self resetPDFToolTipRects]; - [editor updateLayout]; + if (editor) { + if ([self isPageAtIndexDisplayed:[currentAnnotation pageIndex]]) + [editor updateFrame]; + else + [self commitEditing]; + } } #pragma mark Drawing @@ -2790,19 +2795,18 @@ } - (void)discardEditing { - [editor discardEditing]; + [editor endEditingWithCommit:NO]; } - (BOOL)commitEditing { - BOOL success = YES; if (editor) { NSUndoManager *undoManager = [self undoManager]; NSInteger level = [undoManager groupingLevel]; - success = [editor commitEditing]; + [editor endEditingWithCommit:YES]; if ([undoManager groupingLevel] > level) wantsNewUndoGroup = YES; } - return success; + return YES; } - (void)beginNewUndoGroupIfNeeded { @@ -3143,10 +3147,14 @@ PDFAnnotation *annotation = [userInfo objectForKey:SKPDFDocumentAnnotationKey]; [self updatedAnnotation:annotation]; - if ([annotation isNote]) + if ([annotation isNote]) { [self resetPDFToolTipRects]; - if ([self isEditingAnnotation:annotation]) - [editor updateLayout]; + } else if ([self isEditingAnnotation:annotation]) { + if ([self isPageAtIndexDisplayed:[annotation pageIndex]]) + [editor updateFrame]; + else + [self commitEditing]; + } } - (void)registerForDocumentNotifications { @@ -3184,7 +3192,7 @@ - (void)handleScaleChangedNotification:(NSNotification *)notification { [self resetPDFToolTipRects]; [self updatePacer]; - [editor updateLayout]; + [editor updateFrame]; } - (void)handleUpdateTrackingAreasNotification:(NSNotification *)notification { Modified: trunk/SKTextNoteEditor.h =================================================================== --- trunk/SKTextNoteEditor.h 2025-07-11 14:28:15 UTC (rev 15639) +++ trunk/SKTextNoteEditor.h 2025-07-11 14:43:33 UTC (rev 15640) @@ -53,11 +53,9 @@ @property (nonatomic, nullable, weak, readonly) NSString *currentString; - (void)startEditingWithEvent:(nullable NSEvent *)event; -- (void)updateLayout; +- (void)endEditingWithCommit:(BOOL)commit; +- (void)updateFrame; -- (void)discardEditing; -- (BOOL)commitEditing; - @end @interface PDFView (SKTextNoteEditor) Modified: trunk/SKTextNoteEditor.m =================================================================== --- trunk/SKTextNoteEditor.m 2025-07-11 14:28:15 UTC (rev 15639) +++ trunk/SKTextNoteEditor.m 2025-07-11 14:43:33 UTC (rev 15640) @@ -196,22 +196,6 @@ } } -- (void)updateLayout { - if ([pdfView isPageAtIndexDisplayed:[annotation pageIndex]]) - [self updateFrame]; - else - [self endEditingWithCommit:YES]; -} - -- (void)discardEditing { - [self endEditingWithCommit:NO]; -} - -- (BOOL)commitEditing { - [self endEditingWithCommit:YES]; - return YES; -} - - (BOOL)textView:(NSTextView *)aTextView doCommandBySelector:(SEL)command { if (command == @selector(insertTab:)) { [self endEditingWithCommit:YES]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-11 14:28:16
|
Revision: 15639 http://sourceforge.net/p/skim-app/code/15639 Author: hofman Date: 2025-07-11 14:28:15 +0000 (Fri, 11 Jul 2025) Log Message: ----------- no need to make pdfview first responder before starting edit Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2025-07-11 14:26:07 UTC (rev 15638) +++ trunk/SKPDFView.m 2025-07-11 14:28:15 UTC (rev 15639) @@ -2770,7 +2770,6 @@ return; editor = [[SKTextNoteEditor alloc] initWithPDFView:self annotation:currentAnnotation]; - [[self window] makeFirstResponder:self]; [editor startEditingWithEvent:theEvent]; [self updatedAnnotation:currentAnnotation]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-11 14:26:09
|
Revision: 15638 http://sourceforge.net/p/skim-app/code/15638 Author: hofman Date: 2025-07-11 14:26:07 +0000 (Fri, 11 Jul 2025) Log Message: ----------- use correct method Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2025-07-11 09:32:17 UTC (rev 15637) +++ trunk/SKPDFView.m 2025-07-11 14:26:07 UTC (rev 15638) @@ -413,7 +413,7 @@ - (void)layoutDocumentView { [super layoutDocumentView]; [self resetPDFToolTipRects]; - [editor layout]; + [editor updateLayout]; } #pragma mark Drawing @@ -3147,7 +3147,7 @@ if ([annotation isNote]) [self resetPDFToolTipRects]; if ([self isEditingAnnotation:annotation]) - [editor layout]; + [editor updateLayout]; } - (void)registerForDocumentNotifications { @@ -3185,7 +3185,7 @@ - (void)handleScaleChangedNotification:(NSNotification *)notification { [self resetPDFToolTipRects]; [self updatePacer]; - [editor layout]; + [editor updateLayout]; } - (void)handleUpdateTrackingAreasNotification:(NSNotification *)notification { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-11 09:32:20
|
Revision: 15637 http://sourceforge.net/p/skim-app/code/15637 Author: hofman Date: 2025-07-11 09:32:17 +0000 (Fri, 11 Jul 2025) Log Message: ----------- use separate mehods to start editing text note and updating its layout Modified Paths: -------------- trunk/SKPDFView.m trunk/SKTextNoteEditor.h trunk/SKTextNoteEditor.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2025-07-11 09:16:30 UTC (rev 15636) +++ trunk/SKPDFView.m 2025-07-11 09:32:17 UTC (rev 15637) @@ -413,7 +413,7 @@ - (void)layoutDocumentView { [super layoutDocumentView]; [self resetPDFToolTipRects]; - [editor layoutWithEvent:nil]; + [editor layout]; } #pragma mark Drawing @@ -2771,7 +2771,7 @@ editor = [[SKTextNoteEditor alloc] initWithPDFView:self annotation:currentAnnotation]; [[self window] makeFirstResponder:self]; - [editor layoutWithEvent:theEvent]; + [editor startEditingWithEvent:theEvent]; [self updatedAnnotation:currentAnnotation]; } @@ -3147,7 +3147,7 @@ if ([annotation isNote]) [self resetPDFToolTipRects]; if ([self isEditingAnnotation:annotation]) - [editor layoutWithEvent:nil]; + [editor layout]; } - (void)registerForDocumentNotifications { @@ -3185,7 +3185,7 @@ - (void)handleScaleChangedNotification:(NSNotification *)notification { [self resetPDFToolTipRects]; [self updatePacer]; - [editor layoutWithEvent:nil]; + [editor layout]; } - (void)handleUpdateTrackingAreasNotification:(NSNotification *)notification { Modified: trunk/SKTextNoteEditor.h =================================================================== --- trunk/SKTextNoteEditor.h 2025-07-11 09:16:30 UTC (rev 15636) +++ trunk/SKTextNoteEditor.h 2025-07-11 09:32:17 UTC (rev 15637) @@ -52,7 +52,8 @@ @property (nonatomic, nullable, weak, readonly) NSString *currentString; -- (void)layoutWithEvent:(nullable NSEvent *)event; +- (void)startEditingWithEvent:(nullable NSEvent *)event; +- (void)updateLayout; - (void)discardEditing; - (BOOL)commitEditing; Modified: trunk/SKTextNoteEditor.m =================================================================== --- trunk/SKTextNoteEditor.m 2025-07-11 09:16:30 UTC (rev 15636) +++ trunk/SKTextNoteEditor.m 2025-07-11 09:32:17 UTC (rev 15637) @@ -39,7 +39,6 @@ #import "SKTextNoteEditor.h" #import "PDFView_SKExtensions.h" #import "PDFAnnotation_SKExtensions.h" -#import "PDFPage_SKExtensions.h" #import "NSView_SKExtensions.h" #import "NSEvent_SKExtensions.h" #import "SKChainedUndoManager.h" @@ -90,7 +89,7 @@ return [textView string] ?: [annotation string]; } -- (void)updateFrame:(NSNotification *)note { +- (void)updateFrame { NSRect frame = [pdfView backingAlignedRect:[pdfView convertRect:[annotation bounds] fromPage:[annotation page]] options:NSAlignAllEdgesNearest]; frame = [pdfView convertRect:frame toView:[pdfView documentView]]; [self setFrame:frame]; @@ -146,8 +145,6 @@ [self addSubview:clipView]; [self updateParagraphStyle]; - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateFrame:) name:SKPDFPageBoundsDidChangeNotification object:[pdfView document]]; } - (void)endEditingWithCommit:(BOOL)commit { @@ -182,29 +179,30 @@ [thePdfView textNoteEditorDidEndEditing:self]; } -- (void)layoutWithEvent:(NSEvent *)event { - if ([pdfView isPageAtIndexDisplayed:[annotation pageIndex]]) { - [self setUpTextView]; - [self updateFrame:nil]; - if ([self superview] == nil) { - [[pdfView documentView] addSubview:self]; - [[pdfView window] recalculateKeyViewLoop]; - [textView scrollPoint:NSZeroPoint]; - if (event) { - [[textView window] makeFirstResponder:textView]; - [textView mouseDown:event]; - } else if ([[[pdfView window] firstResponder] isEqual:pdfView]) { - NSRange range = NSMakeRange(0, [[textView string] length]); - [textView setSelectedRange:range]; - [[textView window] makeFirstResponder:textView]; - } - [annotation setShouldDisplay:NO]; - } +- (void)startEditingWithEvent:(NSEvent *)event { + [self setUpTextView]; + [self updateFrame]; + [[pdfView documentView] addSubview:self]; + [[pdfView window] recalculateKeyViewLoop]; + [textView scrollPoint:NSZeroPoint]; + [annotation setShouldDisplay:NO]; + if (event) { + [[textView window] makeFirstResponder:textView]; + [textView mouseDown:event]; } else { - [self endEditingWithCommit:YES]; + NSRange range = NSMakeRange(0, [[textView string] length]); + [textView setSelectedRange:range]; + [[textView window] makeFirstResponder:textView]; } } +- (void)updateLayout { + if ([pdfView isPageAtIndexDisplayed:[annotation pageIndex]]) + [self updateFrame]; + else + [self endEditingWithCommit:YES]; +} + - (void)discardEditing { [self endEditingWithCommit:NO]; } @@ -243,7 +241,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if (context == &SKPDFAnnotationPropertiesObservationContext) { if ([keyPath isEqualToString:SKNPDFAnnotationBoundsKey]) { - [self updateFrame:nil]; + [self updateFrame]; } else if ([keyPath isEqualToString:SKNPDFAnnotationFontKey]) { [textView setFont:[annotation font]]; [self updateParagraphStyle]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-11 09:16:32
|
Revision: 15636 http://sourceforge.net/p/skim-app/code/15636 Author: hofman Date: 2025-07-11 09:16:30 +0000 (Fri, 11 Jul 2025) Log Message: ----------- update tooltip rects and text notet editor layout from layoutDocumentView, will catch a lot of display setting changes, but not e.g. pinch zoom Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2025-07-10 16:35:33 UTC (rev 15635) +++ trunk/SKPDFView.m 2025-07-11 09:16:30 UTC (rev 15636) @@ -408,6 +408,14 @@ } } +#pragma mark Layout + +- (void)layoutDocumentView { + [super layoutDocumentView]; + [self resetPDFToolTipRects]; + [editor layoutWithEvent:nil]; +} + #pragma mark Drawing - (BOOL)drawsActiveSelections { @@ -698,8 +706,6 @@ [super setDisplayMode:mode]; if (page && [page isEqual:[self currentPage]] == NO) [self goToCurrentPage:page]; - [self resetPDFToolTipRects]; - [editor layoutWithEvent:nil]; } } @@ -737,8 +743,6 @@ [self _setDisplaysHorizontally:horizontal]; if (page && [page isEqual:[self currentPage]] == NO) [self goToCurrentPage:page]; - [self resetPDFToolTipRects]; - [editor layoutWithEvent:nil]; } } @@ -760,8 +764,6 @@ [self _setDisplaysHorizontally:flag]; if (page && [page isEqual:[self currentPage]] == NO) [self goToCurrentPage:page]; - [self resetPDFToolTipRects]; - [editor layoutWithEvent:nil]; } } @@ -780,8 +782,6 @@ [self layoutDocumentView]; if (page && [page isEqual:[self currentPage]] == NO) [self goToCurrentPage:page]; - [self resetPDFToolTipRects]; - [editor layoutWithEvent:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:SKPDFViewDisplaysRTLChangedNotification object:self]; } } @@ -800,8 +800,6 @@ [super setDisplayBox:box]; if (page && [page isEqual:[self currentPage]] == NO) [self goToCurrentPage:page]; - [self resetPDFToolTipRects]; - [editor layoutWithEvent:nil]; } } @@ -819,8 +817,6 @@ [super setDisplaysAsBook:asBook]; if (page && [page isEqual:[self currentPage]] == NO) [self goToCurrentPage:page]; - [self resetPDFToolTipRects]; - [editor layoutWithEvent:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:SKPDFViewDisplaysAsBookChangedNotification object:self]; } } @@ -836,8 +832,6 @@ - (void)setDisplaysPageBreaks:(BOOL)pageBreaks { if (pageBreaks != [self displaysPageBreaks]) { [super setDisplaysPageBreaks:pageBreaks]; - [self resetPDFToolTipRects]; - [editor layoutWithEvent:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:SKPDFViewDisplaysPageBreaksChangedNotification object:self]; } } @@ -3183,8 +3177,6 @@ - (void)handlePageChangedNotification:(NSNotification *)notification { if ([self displayMode] == kPDFDisplaySinglePage || [self displayMode] == kPDFDisplayTwoUp) { - [editor layoutWithEvent:nil]; - [self resetPDFToolTipRects]; if (toolMode == SKToolModeMagnify) [loupeController updateContents]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-10 16:35:35
|
Revision: 15635 http://sourceforge.net/p/skim-app/code/15635 Author: hofman Date: 2025-07-10 16:35:33 +0000 (Thu, 10 Jul 2025) Log Message: ----------- fix comment Modified Paths: -------------- trunk/SKTextNoteEditor.m Modified: trunk/SKTextNoteEditor.m =================================================================== --- trunk/SKTextNoteEditor.m 2025-07-10 16:16:43 UTC (rev 15634) +++ trunk/SKTextNoteEditor.m 2025-07-10 16:35:33 UTC (rev 15635) @@ -164,7 +164,7 @@ annotation = nil; - // avoid getting textDidEndDelegate: messages + // avoid getting textDidEndEditing: messages [textView setDelegate:nil]; if ([self superview]) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-10 16:16:46
|
Revision: 15634 http://sourceforge.net/p/skim-app/code/15634 Author: hofman Date: 2025-07-10 16:16:43 +0000 (Thu, 10 Jul 2025) Log Message: ----------- relayout text note editor after scale change from pdfvieww Modified Paths: -------------- trunk/SKPDFView.m trunk/SKTextNoteEditor.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2025-07-10 15:52:14 UTC (rev 15633) +++ trunk/SKPDFView.m 2025-07-10 16:16:43 UTC (rev 15634) @@ -3193,6 +3193,7 @@ - (void)handleScaleChangedNotification:(NSNotification *)notification { [self resetPDFToolTipRects]; [self updatePacer]; + [editor layoutWithEvent:nil]; } - (void)handleUpdateTrackingAreasNotification:(NSNotification *)notification { Modified: trunk/SKTextNoteEditor.m =================================================================== --- trunk/SKTextNoteEditor.m 2025-07-10 15:52:14 UTC (rev 15633) +++ trunk/SKTextNoteEditor.m 2025-07-10 16:16:43 UTC (rev 15634) @@ -147,7 +147,6 @@ [self updateParagraphStyle]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateFrame:) name:PDFViewScaleChangedNotification object:pdfView]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateFrame:) name:SKPDFPageBoundsDidChangeNotification object:[pdfView document]]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-10 15:52:17
|
Revision: 15633 http://sourceforge.net/p/skim-app/code/15633 Author: hofman Date: 2025-07-10 15:52:14 +0000 (Thu, 10 Jul 2025) Log Message: ----------- avoid converting rect back and forth from page Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2025-07-10 14:47:03 UTC (rev 15632) +++ trunk/SKPDFView.m 2025-07-10 15:52:14 UTC (rev 15633) @@ -4765,7 +4765,7 @@ NSRect rect = [self convertRect:selRect fromView:[self documentView]]; NSRect bounds; NSInteger factor = 1; - BOOL autoFits = NO; + BOOL autoFits = YES; if (dragged) { @@ -4790,14 +4790,11 @@ if (NSMaxX(rect) > NSMaxY(bounds)) rect.origin.y = NSMaxY(bounds) - NSHeight(rect); } + rect = [self convertRect:rect toPage:page]; - autoFits = YES; - } else if (toolMode == SKToolModeSelect && NSIsEmptyRect(selectionRect) == NO) { rect = NSIntersectionRect(selectionRect, [page boundsForBox:kPDFDisplayBoxCropBox]); - rect = [self convertRect:rect fromPage:page]; - autoFits = YES; } else { @@ -4815,11 +4812,14 @@ rect = [self convertRect:[page boundsForBox:kPDFDisplayBoxCropBox] fromPage:page]; rect.origin.y = point.y - 0.5 * DEFAULT_SNAPSHOT_HEIGHT; rect.size.height = DEFAULT_SNAPSHOT_HEIGHT; + rect = [self convertRect:rect toPage:page]; + autoFits = NO; + } if ([[self delegate] respondsToSelector:@selector(PDFView:showSnapshotAtPageNumber:forRect:scaleFactor:autoFits:)]) - [[self delegate] PDFView:self showSnapshotAtPageNumber:[page pageIndex] forRect:[self convertRect:rect toPage:page] scaleFactor:[self scaleFactor] * factor autoFits:autoFits]; + [[self delegate] PDFView:self showSnapshotAtPageNumber:[page pageIndex] forRect:rect scaleFactor:[self scaleFactor] * factor autoFits:autoFits]; } - (void)removeLoupeWindow { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-10 14:47:05
|
Revision: 15632 http://sourceforge.net/p/skim-app/code/15632 Author: hofman Date: 2025-07-10 14:47:03 +0000 (Thu, 10 Jul 2025) Log Message: ----------- remove unused import Modified Paths: -------------- trunk/NSScanner_SKExtensions.m Modified: trunk/NSScanner_SKExtensions.m =================================================================== --- trunk/NSScanner_SKExtensions.m 2025-07-09 14:45:56 UTC (rev 15631) +++ trunk/NSScanner_SKExtensions.m 2025-07-10 14:47:03 UTC (rev 15632) @@ -37,7 +37,6 @@ */ #import "NSScanner_SKExtensions.h" -#import "NSCharacterSet_SKExtensions.h" @implementation NSScanner (SKExtensions) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-09 14:45:59
|
Revision: 15631 http://sourceforge.net/p/skim-app/code/15631 Author: hofman Date: 2025-07-09 14:45:56 +0000 (Wed, 09 Jul 2025) Log Message: ----------- remove magnifyWithEvent: overrides, as they will never be called, and have not bbeen implemented in PDFView for a long time. Also [SKDisablePinchZoom](#pinch-zoom) | boolean | false Modified Paths: -------------- trunk/SKSecondaryPDFView.m trunk/SKSnapshotPDFView.m trunk/SKStringConstants.h trunk/SKStringConstants.m Modified: trunk/SKSecondaryPDFView.m =================================================================== --- trunk/SKSecondaryPDFView.m 2025-07-09 14:02:28 UTC (rev 15630) +++ trunk/SKSecondaryPDFView.m 2025-07-09 14:45:56 UTC (rev 15631) @@ -102,9 +102,8 @@ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handlePageChangedNotification:) name:PDFViewPageChangedNotification object:self]; - if ([PDFView instancesRespondToSelector:@selector(magnifyWithEvent:)] == NO || [PDFView instanceMethodForSelector:@selector(magnifyWithEvent:)] == [NSView instanceMethodForSelector:@selector(magnifyWithEvent:)]) - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handlePDFViewScaleChangedNotification:) - name:PDFViewScaleChangedNotification object:self]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handlePDFViewScaleChangedNotification:) + name:PDFViewScaleChangedNotification object:self]; } - (instancetype)initWithFrame:(NSRect)frameRect { @@ -671,17 +670,6 @@ [super endGestureWithEvent:theEvent]; } -- (void)magnifyWithEvent:(NSEvent *)theEvent { - if ([[NSUserDefaults standardUserDefaults] boolForKey:SKDisablePinchZoomKey] == NO) { - if ([theEvent phase] == NSEventPhaseBegan) - startScale = [self scaleFactor]; - CGFloat magnifyFactor = (1.0 + fmax(-0.5, fmin(1.0 , [theEvent magnification]))); - [super setScaleFactor:magnifyFactor * [self scaleFactor]]; - if (([theEvent phase] == NSEventPhaseEnded || [theEvent phase] == NSEventPhaseCancelled) && fabs(startScale - [self scaleFactor]) > 0.001) - [self setScaleFactor:fmax([self scaleFactor], SKMinDefaultScaleMenuFactor) adjustPopup:YES]; - } -} - #pragma mark Dragging - (void)mouseDown:(NSEvent *)theEvent{ Modified: trunk/SKSnapshotPDFView.m =================================================================== --- trunk/SKSnapshotPDFView.m 2025-07-09 14:02:28 UTC (rev 15630) +++ trunk/SKSnapshotPDFView.m 2025-07-09 14:45:56 UTC (rev 15631) @@ -104,9 +104,8 @@ name:NSViewBoundsDidChangeNotification object:[[self scrollView] contentView]]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handlePDFContentViewFrameChangedDelayedNotification:) name:SKPDFContentViewChangedNotification object:self]; - if ([PDFView instancesRespondToSelector:@selector(magnifyWithEvent:)] == NO || [PDFView instanceMethodForSelector:@selector(magnifyWithEvent:)] == [NSView instanceMethodForSelector:@selector(magnifyWithEvent:)]) - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handlePDFViewScaleChangedNotification:) - name:PDFViewScaleChangedNotification object:self]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handlePDFViewScaleChangedNotification:) + name:PDFViewScaleChangedNotification object:self]; } - (instancetype)initWithFrame:(NSRect)frameRect { @@ -593,17 +592,6 @@ [super endGestureWithEvent:theEvent]; } -- (void)magnifyWithEvent:(NSEvent *)theEvent { - if ([[NSUserDefaults standardUserDefaults] boolForKey:SKDisablePinchZoomKey] == NO) { - if ([theEvent phase] == NSEventPhaseBegan) - startScale = [self scaleFactor]; - CGFloat magnifyFactor = (1.0 + fmax(-0.5, fmin(1.0 , [theEvent magnification]))); - [super setScaleFactor:magnifyFactor * [self scaleFactor]]; - if (([theEvent phase] == NSEventPhaseEnded || [theEvent phase] == NSEventPhaseCancelled) && fabs(startScale - [self scaleFactor]) > 0.001) - [self setScaleFactor:fmax([self scaleFactor], SKMinDefaultScaleMenuFactor) adjustPopup:YES]; - } -} - #pragma mark Dragging - (void)mouseDown:(NSEvent *)theEvent{ Modified: trunk/SKStringConstants.h =================================================================== --- trunk/SKStringConstants.h 2025-07-09 14:02:28 UTC (rev 15630) +++ trunk/SKStringConstants.h 2025-07-09 14:45:56 UTC (rev 15631) @@ -126,7 +126,6 @@ extern NSString *SKSequentialPageNumberingKey; extern NSString *SKUseUserNameKey; extern NSString *SKUserNameKey; -extern NSString *SKDisablePinchZoomKey; extern NSString *SKDisableModificationDateKey; extern NSString *SKDisableAnimationsKey; extern NSString *SKDisableUpdateContentsFromEnclosedTextKey; Modified: trunk/SKStringConstants.m =================================================================== --- trunk/SKStringConstants.m 2025-07-09 14:02:28 UTC (rev 15630) +++ trunk/SKStringConstants.m 2025-07-09 14:45:56 UTC (rev 15631) @@ -126,7 +126,6 @@ NSString *SKSequentialPageNumberingKey = @"SKSequentialPageNumbering"; NSString *SKUseUserNameKey = @"SKUseUserName"; NSString *SKUserNameKey = @"SKUserName"; -NSString *SKDisablePinchZoomKey = @"SKDisablePinchZoom"; NSString *SKDisableModificationDateKey = @"SKDisableModificationDate"; NSString *SKDisableAnimationsKey = @"SKDisableAnimations"; NSString *SKDisableUpdateContentsFromEnclosedTextKey = @"SKDisableUpdateContentsFromEnclosedText"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-09 14:02:30
|
Revision: 15630 http://sourceforge.net/p/skim-app/code/15630 Author: hofman Date: 2025-07-09 14:02:28 +0000 (Wed, 09 Jul 2025) Log Message: ----------- there is no need to check for presentation mode Modified Paths: -------------- trunk/SKMainWindowController_UI.m Modified: trunk/SKMainWindowController_UI.m =================================================================== --- trunk/SKMainWindowController_UI.m 2025-07-09 09:38:33 UTC (rev 15629) +++ trunk/SKMainWindowController_UI.m 2025-07-09 14:02:28 UTC (rev 15630) @@ -1545,7 +1545,7 @@ } - (BOOL)PDFView:(PDFView *)aPDFView performAction:(PDFAction *)action { - if ([self interactionMode] != SKPresentationMode && [action isKindOfClass:[PDFActionGoTo class]] && ([NSEvent modifierFlags] & NSEventModifierFlagDeviceIndependentFlagsMask) == NSEventModifierFlagShift) { + if ([action isKindOfClass:[PDFActionGoTo class]] && ([NSEvent modifierFlags] & NSEventModifierFlagDeviceIndependentFlagsMask) == NSEventModifierFlagShift) { if ([secondaryPdfView window] == nil) [self toggleSplitPDF:nil]; if ([pdfSplitView isAnimating]) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-09 09:38:35
|
Revision: 15629 http://sourceforge.net/p/skim-app/code/15629 Author: hofman Date: 2025-07-09 09:38:33 +0000 (Wed, 09 Jul 2025) Log Message: ----------- don't override magnifyWithEvent: as it is not implemented in PDFView since 10.12 Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2025-07-09 09:17:08 UTC (rev 15628) +++ trunk/SKPDFView.m 2025-07-09 09:38:33 UTC (rev 15629) @@ -2181,12 +2181,6 @@ } } -- (void)magnifyWithEvent:(NSEvent *)theEvent { - if ([[NSUserDefaults standardUserDefaults] boolForKey:SKDisablePinchZoomKey] == NO) - [super magnifyWithEvent:theEvent]; -} - - - (void)performAction:(PDFAction *)action { if ([[self delegate] respondsToSelector:@selector(PDFView:performAction:)] == NO || [[self delegate] PDFView:self performAction:action] == NO) [super performAction:action]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-09 09:17:11
|
Revision: 15628 http://sourceforge.net/p/skim-app/code/15628 Author: hofman Date: 2025-07-09 09:17:08 +0000 (Wed, 09 Jul 2025) Log Message: ----------- no need for private method Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2025-07-09 09:11:53 UTC (rev 15627) +++ trunk/SKPDFView.m 2025-07-09 09:17:08 UTC (rev 15628) @@ -185,7 +185,6 @@ @interface PDFView (SKPrivateDeclarations) - (BOOL)writeSelectionToPasteboard:(NSPasteboard *)pboard types:(NSArray *)types; -- (BOOL)hasEnabledSwipeGestures; - (void)enableSwipeGestures:(BOOL)flag; @end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-09 09:11:54
|
Revision: 15627 http://sourceforge.net/p/skim-app/code/15627 Author: hofman Date: 2025-07-09 09:11:53 +0000 (Wed, 09 Jul 2025) Log Message: ----------- remove unused imports Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2025-07-08 21:46:20 UTC (rev 15626) +++ trunk/SKPDFView.m 2025-07-09 09:11:53 UTC (rev 15627) @@ -42,6 +42,7 @@ #import "PDFAnnotation_SKExtensions.h" #import "PDFAnnotationMarkup_SKExtensions.h" #import "PDFAnnotationInk_SKExtensions.h" +#import "PDFAnnotationLine_SKExtensions.h" #import "SKNPDFAnnotationNote_SKExtensions.h" #import "PDFPage_SKExtensions.h" #import "NSString_SKExtensions.h" @@ -55,7 +56,6 @@ #import "SKLineInspector.h" #import "SKLineWell.h" #import "SKTypeSelectHelper.h" -#import <CoreServices/CoreServices.h> #import "NSDocument_SKExtensions.h" #import "PDFSelection_SKExtensions.h" #import "NSBezierPath_SKExtensions.h" @@ -66,18 +66,13 @@ #import "PDFView_SKExtensions.h" #import "NSMenu_SKExtensions.h" #import "NSGraphics_SKExtensions.h" -#import "NSArray_SKExtensions.h" -#import "NSColor_SKExtensions.h" #import "NSView_SKExtensions.h" #import "NSPointerArray_SKExtensions.h" -#import "NSShadow_SKExtensions.h" -#import "PDFAnnotationLine_SKExtensions.h" #import "NSScroller_SKExtensions.h" #import "SKColorMenuView.h" #import "NSObject_SKExtensions.h" #import "SKLoupeController.h" #import "PDFDestination_SKExtensions.h" -#import "NSSegmentedControl_SKExtensions.h" #define ANNOTATION_MODE_COUNT 9 #define TOOL_MODE_COUNT 5 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-08 21:46:21
|
Revision: 15626 http://sourceforge.net/p/skim-app/code/15626 Author: hofman Date: 2025-07-08 21:46:20 +0000 (Tue, 08 Jul 2025) Log Message: ----------- remove unused macro Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2025-07-08 21:44:42 UTC (rev 15625) +++ trunk/SKPDFView.m 2025-07-08 21:46:20 UTC (rev 15626) @@ -90,7 +90,6 @@ #define TEMP_TOOL_MODE_FROM_NOTE_TYPE(noteType) (SKTemporaryToolMode)(noteType + SKToolModeFreeText) #define READINGBAR_RESIZE_EDGE_HEIGHT 3.0 -#define NAVIGATION_BOTTOM_EDGE_HEIGHT 5.0 #define TEXT_SELECT_MARGIN_SIZE ((NSSize){80.0, 100.0}) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-08 21:44:44
|
Revision: 15625 http://sourceforge.net/p/skim-app/code/15625 Author: hofman Date: 2025-07-08 21:44:42 +0000 (Tue, 08 Jul 2025) Log Message: ----------- remove unused #import Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2025-07-08 16:12:55 UTC (rev 15624) +++ trunk/SKPDFView.m 2025-07-08 21:44:42 UTC (rev 15625) @@ -74,7 +74,6 @@ #import "PDFAnnotationLine_SKExtensions.h" #import "NSScroller_SKExtensions.h" #import "SKColorMenuView.h" -#import "SKMainWindowController_Actions.h" #import "NSObject_SKExtensions.h" #import "SKLoupeController.h" #import "PDFDestination_SKExtensions.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-08 16:12:58
|
Revision: 15624 http://sourceforge.net/p/skim-app/code/15624 Author: hofman Date: 2025-07-08 16:12:55 +0000 (Tue, 08 Jul 2025) Log Message: ----------- include isSkimNotes check in hitTest: check Modified Paths: -------------- trunk/PDFAnnotationLine_SKExtensions.m trunk/PDFAnnotation_SKExtensions.m trunk/SKPDFView.m trunk/SKPresentationView.m Modified: trunk/PDFAnnotationLine_SKExtensions.m =================================================================== --- trunk/PDFAnnotationLine_SKExtensions.m 2025-07-08 16:03:29 UTC (rev 15623) +++ trunk/PDFAnnotationLine_SKExtensions.m 2025-07-08 16:12:55 UTC (rev 15624) @@ -135,8 +135,10 @@ - (BOOL)isConvertibleAnnotation { return YES; } - (BOOL)hitTest:(NSPoint)point { + if ([self shouldDisplay] == NO || [self isSkimNote] == NO) + return NO; CGFloat delta = fmax(4.0, 0.5 * [self lineWidth]); - return [self shouldDisplay] && SKPointNearLineFromPointToPoint(SKSubstractPoints(point, [self bounds].origin), [self startPoint], [self endPoint], delta); + return SKPointNearLineFromPointToPoint(SKSubstractPoints(point, [self bounds].origin), [self startPoint], [self endPoint], delta); } - (CGFloat)boundsOrder { Modified: trunk/PDFAnnotation_SKExtensions.m =================================================================== --- trunk/PDFAnnotation_SKExtensions.m 2025-07-08 16:03:29 UTC (rev 15623) +++ trunk/PDFAnnotation_SKExtensions.m 2025-07-08 16:12:55 UTC (rev 15624) @@ -461,7 +461,7 @@ } - (BOOL)hitTest:(NSPoint)point { - return [self shouldDisplay] ? NSPointInRect(point, [self bounds]) : NO; + return [self shouldDisplay] && [self isSkimNote] && NSPointInRect(point, [self bounds]); } - (CGFloat)boundsOrder { Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2025-07-08 16:03:29 UTC (rev 15623) +++ trunk/SKPDFView.m 2025-07-08 16:12:55 UTC (rev 15624) @@ -2220,13 +2220,9 @@ NSPoint location = [self convertPoint:[sender draggingLocation] fromView:nil]; PDFPage *page = [self pageForPoint:location nearest:NO]; if (page) { - NSArray *annotations = [page annotations]; - PDFAnnotation *annotation = nil; - NSInteger i = [annotations count]; location = [self convertPoint:location toPage:page]; - while (i-- > 0) { - annotation = [annotations objectAtIndex:i]; - if ([annotation isSkimNote] && [annotation hitTest:location] && + for (PDFAnnotation *annotation in [[page annotations] reverseObjectEnumerator]) { + if ([annotation hitTest:location] && ([pboard canReadItemWithDataConformingToTypes:@[NSPasteboardTypeColor]] || [annotation hasBorder])) { [self setHighlightAnnotation:annotation]; dragOp = NSDragOperationGeneric; @@ -4194,7 +4190,7 @@ for (PDFAnnotation *annotation in annotations) { if ([annotation shouldDisplay] == NO) { continue; - } else if ([annotation isSkimNote] && [annotation hitTest:point]) { + } else if ([annotation hitTest:point]) { newCurrentAnnotation = annotation; break; } else if (NSPointInRect(point, [annotation bounds]) && (toolMode == SKToolModeText || IS_MARKUP(annotationMode)) && linkAnnotation == nil) { @@ -4386,7 +4382,7 @@ id annotations = [[page annotations] reverseObjectEnumerator]; for (PDFAnnotation *annotation in annotations) { - if ([annotation isSkimNote] && [annotation hitTest:point]) { + if ([annotation hitTest:point]) { [self removeAnnotation:annotation]; break; } Modified: trunk/SKPresentationView.m =================================================================== --- trunk/SKPresentationView.m 2025-07-08 16:03:29 UTC (rev 15623) +++ trunk/SKPresentationView.m 2025-07-08 16:12:55 UTC (rev 15624) @@ -1097,7 +1097,7 @@ NSPoint point = [self convertPointToPage:theEvent ? [theEvent locationInView:self] : [self convertPointFromScreen:[NSEvent mouseLocation]]]; for (PDFAnnotation *annotation in [[page annotations] reverseObjectEnumerator]) { - if ([annotation isLink] && [annotation hitTest:point]) + if ([annotation isLink] && NSPointInRect(point, [annotation bounds])) return annotation; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-08 16:03:32
|
Revision: 15623 http://sourceforge.net/p/skim-app/code/15623 Author: hofman Date: 2025-07-08 16:03:29 +0000 (Tue, 08 Jul 2025) Log Message: ----------- no need to test for editing as this will be hidden Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2025-07-08 16:01:41 UTC (rev 15622) +++ trunk/SKPDFView.m 2025-07-08 16:03:29 UTC (rev 15623) @@ -4386,7 +4386,7 @@ id annotations = [[page annotations] reverseObjectEnumerator]; for (PDFAnnotation *annotation in annotations) { - if ([annotation isSkimNote] && [annotation hitTest:point] && [self isEditingAnnotation:annotation] == NO) { + if ([annotation isSkimNote] && [annotation hitTest:point]) { [self removeAnnotation:annotation]; break; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-08 16:01:43
|
Revision: 15622 http://sourceforge.net/p/skim-app/code/15622 Author: hofman Date: 2025-07-08 16:01:41 +0000 (Tue, 08 Jul 2025) Log Message: ----------- ignore annotations that don't display immediately, no need to test for editing as this will be hidden Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2025-07-08 15:24:11 UTC (rev 15621) +++ trunk/SKPDFView.m 2025-07-08 16:01:41 UTC (rev 15622) @@ -4192,10 +4192,12 @@ // Hit test for annotation. for (PDFAnnotation *annotation in annotations) { - if ([annotation isSkimNote] && [annotation hitTest:point] && [self isEditingAnnotation:annotation] == NO) { + if ([annotation shouldDisplay] == NO) { + continue; + } else if ([annotation isSkimNote] && [annotation hitTest:point]) { newCurrentAnnotation = annotation; break; - } else if ([annotation shouldDisplay] && NSPointInRect(point, [annotation bounds]) && (toolMode == SKToolModeText || IS_MARKUP(annotationMode)) && linkAnnotation == nil) { + } else if (NSPointInRect(point, [annotation bounds]) && (toolMode == SKToolModeText || IS_MARKUP(annotationMode)) && linkAnnotation == nil) { if ([annotation isLink]) linkAnnotation = annotation; else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-08 15:24:13
|
Revision: 15621 http://sourceforge.net/p/skim-app/code/15621 Author: hofman Date: 2025-07-08 15:24:11 +0000 (Tue, 08 Jul 2025) Log Message: ----------- ignore periodic events before dragging as there will be nothing to scroll Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2025-07-08 15:03:04 UTC (rev 15620) +++ trunk/SKPDFView.m 2025-07-08 15:24:11 UTC (rev 15621) @@ -4104,7 +4104,7 @@ [[[self scrollView] contentView] autoscroll:lastMouseEvent]; } } else if ([theEvent type] == NSEventTypePeriodic) { - if (currentAnnotation == nil || [[[self scrollView] contentView] autoscroll:lastMouseEvent] == NO) + if (draggedAnnotation == NO || [[[self scrollView] contentView] autoscroll:lastMouseEvent] == NO) continue; } BOOL shiftDown = ([theEvent modifierFlags] & NSEventModifierFlagShift) != 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-08 15:03:06
|
Revision: 15620 http://sourceforge.net/p/skim-app/code/15620 Author: hofman Date: 2025-07-08 15:03:04 +0000 (Tue, 08 Jul 2025) Log Message: ----------- get bounds first for any type Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2025-07-08 14:34:19 UTC (rev 15619) +++ trunk/SKPDFView.m 2025-07-08 15:03:04 UTC (rev 15620) @@ -4052,18 +4052,17 @@ if (shouldAddAnnotation) { if (temporaryToolMode >= SKToolModeFreeText) noteType = NOTE_TYPE_FROM_TEMP_TOOL_MODE(temporaryToolMode); + originalBounds = SKRectFromCenterAndSquareSize(SKIntegralPoint(initialPoint), 0.0); if (noteType == SKNoteTypeAnchored) { - [self addAnnotationWithType:SKNoteTypeAnchored selection:nil page:page bounds:SKRectFromCenterAndSquareSize(SKIntegralPoint(initialPoint), 0.0)]; + [self addAnnotationWithType:SKNoteTypeAnchored selection:nil page:page bounds:originalBounds]; + resizeHandle = 0; originalBounds = [[self currentAnnotation] bounds]; + } else if (noteType == SKNoteTypeLine) { + isLine = YES; + resizeHandle = SKMaxXEdgeMask; + originalStartPoint = originalEndPoint = originalBounds.origin; } else { - originalBounds = SKRectFromCenterAndSquareSize(SKIntegralPoint(initialPoint), 0.0); - if (noteType == SKNoteTypeLine) { - isLine = YES; - resizeHandle = SKMaxXEdgeMask; - originalStartPoint = originalEndPoint = originalBounds.origin; - } else { - resizeHandle = SKMaxXEdgeMask | SKMinYEdgeMask; - } + resizeHandle = SKMaxXEdgeMask | SKMinYEdgeMask; } } else if (isLine) { originalStartPoint = SKIntegralPoint(SKAddPoints([currentAnnotation startPoint], originalBounds.origin)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-08 14:34:20
|
Revision: 15619 http://sourceforge.net/p/skim-app/code/15619 Author: hofman Date: 2025-07-08 14:34:19 +0000 (Tue, 08 Jul 2025) Log Message: ----------- get mouse location when getting drag event Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2025-07-07 22:10:55 UTC (rev 15618) +++ trunk/SKPDFView.m 2025-07-08 14:34:19 UTC (rev 15619) @@ -4033,8 +4033,9 @@ // Old (current) annotation location and click point relative to it NSRect originalBounds = [currentAnnotation bounds]; BOOL isLine = [currentAnnotation isLine]; - NSPoint initialPoint = NSZeroPoint; - PDFPage *page = [self pageAndPoint:&initialPoint forEvent:theEvent nearest:YES]; + NSPoint mousePoint = [theEvent locationInView:self]; + PDFPage *page = [self pageForPoint:mousePoint nearest:YES]; + NSPoint initialPoint = [self convertPoint:mousePoint toPage:page]; SKNoteType noteType = annotationMode; BOOL shouldAddAnnotation = currentAnnotation == nil; NSPoint originalStartPoint = NSZeroPoint; @@ -4098,31 +4099,32 @@ [self beginNewUndoGroupIfNeeded]; draggedAnnotation = YES; } - lastMouseEvent = theEvent; - if (resizeHandle == 0) - [[[self scrollView] contentView] autoscroll:theEvent]; + mousePoint = [theEvent locationInView:self]; + if (resizeHandle == 0) { + lastMouseEvent = theEvent; + [[[self scrollView] contentView] autoscroll:lastMouseEvent]; + } } else if ([theEvent type] == NSEventTypePeriodic) { if (currentAnnotation == nil || [[[self scrollView] contentView] autoscroll:lastMouseEvent] == NO) continue; } BOOL shiftDown = ([theEvent modifierFlags] & NSEventModifierFlagShift) != 0; - NSPoint point = [lastMouseEvent locationInView:self]; if (resizeHandle == 0) - page = [self pageForPoint:point nearest:YES]; - point = SKSubstractPoints([self convertPoint:point toPage:page], initialPoint); + page = [self pageForPoint:mousePoint nearest:YES]; + NSPoint draggedPoint = SKSubstractPoints([self convertPoint:mousePoint toPage:page], initialPoint); if (resizeHandle == 0) { - [self moveAnnotationToPoint:point onPage:page]; + [self moveAnnotationToPoint:draggedPoint onPage:page]; } else if (isLine) { - [self dragLineAnnotationStartPoint:(resizeHandle & SKMinXEdgeMask) != 0 by:point originalStartPoint:originalStartPoint originalEndPoint:originalEndPoint shiftDown:shiftDown]; + [self dragLineAnnotationStartPoint:(resizeHandle & SKMinXEdgeMask) != 0 by:draggedPoint originalStartPoint:originalStartPoint originalEndPoint:originalEndPoint shiftDown:shiftDown]; } else { if (shouldAddAnnotation) { - SKRectEdges currentResizeHandle = (point.x < 0.0 ? SKMinXEdgeMask : SKMaxXEdgeMask) | (point.y <= 0.0 ? SKMinYEdgeMask : SKMaxYEdgeMask); + SKRectEdges currentResizeHandle = (draggedPoint.x < 0.0 ? SKMinXEdgeMask : SKMaxXEdgeMask) | (draggedPoint.y <= 0.0 ? SKMinYEdgeMask : SKMaxYEdgeMask); if (currentResizeHandle != resizeHandle) { resizeHandle = currentResizeHandle; [self setCursorForAreaOfInterest:SKAreaOfInterestForResizeHandle(resizeHandle, page)]; } } - [self dragAnnotationResizeHandle:resizeHandle by:point originalBounds:originalBounds originalPaths:originalPaths margin:margin shiftDown:shiftDown]; + [self dragAnnotationResizeHandle:resizeHandle by:draggedPoint originalBounds:originalBounds originalPaths:originalPaths margin:margin shiftDown:shiftDown]; } [[highlightLayerController layer] setNeedsDisplay]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-07-07 22:10:56
|
Revision: 15618 http://sourceforge.net/p/skim-app/code/15618 Author: hofman Date: 2025-07-07 22:10:55 +0000 (Mon, 07 Jul 2025) Log Message: ----------- remove somme braces Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2025-07-07 21:38:34 UTC (rev 15617) +++ trunk/SKPDFView.m 2025-07-07 22:10:55 UTC (rev 15618) @@ -3901,9 +3901,8 @@ newBounds.size.width += relPoint.x; if (NSMaxX(newBounds) > NSMaxX(pageBounds)) newBounds.size.width = NSMaxX(pageBounds) - NSMinX(newBounds); - if (NSWidth(newBounds) < minSize) { + if (NSWidth(newBounds) < minSize) newBounds.size.width = minSize; - } } else if ((resizeHandle & SKMinXEdgeMask)) { newBounds.origin.x += relPoint.x; newBounds.size.width -= relPoint.x; @@ -3918,12 +3917,10 @@ } if ((resizeHandle & SKMaxYEdgeMask)) { newBounds.size.height += relPoint.y; - if (NSMaxY(newBounds) > NSMaxY(pageBounds)) { + if (NSMaxY(newBounds) > NSMaxY(pageBounds)) newBounds.size.height = NSMaxY(pageBounds) - NSMinY(newBounds); - } - if (NSHeight(newBounds) < minSize) { + if (NSHeight(newBounds) < minSize) newBounds.size.height = minSize; - } } else if ((resizeHandle & SKMinYEdgeMask)) { newBounds.origin.y += relPoint.y; newBounds.size.height -= relPoint.y; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |