Revision: 14072
          http://sourceforge.net/p/skim-app/code/14072
Author:   hofman
Date:     2024-02-27 19:21:14 +0000 (Tue, 27 Feb 2024)
Log Message:
-----------
Revert previous commits. Don't override scrolling by page. It can have side 
effects, as PDFView's implementation doesmore than just scrolling, i.p. 
updating the current page immediately. And that is already fagile in PDFView.

Modified Paths:
--------------
    trunk/ReleaseNotes.rtf
    trunk/SKBasePDFView.m

Modified: trunk/ReleaseNotes.rtf
===================================================================
--- trunk/ReleaseNotes.rtf      2024-02-27 19:07:49 UTC (rev 14071)
+++ trunk/ReleaseNotes.rtf      2024-02-27 19:21:14 UTC (rev 14072)
@@ -381,7 +381,6 @@
 \ls3\ilvl0
 \f1\i0\b0\fs22 \cf2 {\listtext \uc0\u8226      }Work around initial page 
navigation bug on newer OS systems.\
 {\listtext     \uc0\u8226      }Fix string cleaning for highlights and search.\
-{\listtext     \uc0\u8226      }Fix scrolling by page.\
 \pard\tx560\tx1440\tx2880\tx4320\tx5760\tx7200\partightenfactor0
 
 \f2\b\fs28 \cf2 \

Modified: trunk/SKBasePDFView.m
===================================================================
--- trunk/SKBasePDFView.m       2024-02-27 19:07:49 UTC (rev 14071)
+++ trunk/SKBasePDFView.m       2024-02-27 19:21:14 UTC (rev 14072)
@@ -311,64 +311,6 @@
     [super goToDestination:destination];
 }
 
-- (void)verticallyScrollPageUp:(id)sender {
-    NSScrollView *scrollView = [self scrollView];
-    NSClipView *clipView = [scrollView contentView];
-    NSView *docView = [self documentView];
-    NSRect bounds = [clipView bounds];
-    NSRect docRect = [docView convertRect:[docView bounds] toView:clipView];
-    CGFloat inset = [clipView contentInsets].top;
-    
-    if ([clipView isFlipped])
-        bounds.origin.y = fmin(NSMaxY(docRect) - NSHeight(bounds), 
NSMaxY(bounds) - inset - 10.0);
-    else
-        bounds.origin.y = fmax(NSMinY(docRect), NSMinY(bounds) - 
NSHeight(bounds) + inset + 10.0);
-    [clipView scrollToPoint:bounds.origin];
-    [scrollView reflectScrolledClipView:clipView];
-}
-
-- (void)verticallyScrollPageDown:(id)sender {
-    NSScrollView *scrollView = [self scrollView];
-    NSClipView *clipView = [scrollView contentView];
-    NSView *docView = [self documentView];
-    NSRect bounds = [clipView bounds];
-    NSRect docRect = [docView convertRect:[docView bounds] toView:clipView];
-    CGFloat inset = [clipView contentInsets].top;
-    
-    if ([clipView isFlipped])
-        bounds.origin.y = fmax(NSMinY(docRect) - inset, NSMinY(bounds) - 
NSHeight(bounds) + inset + 10.0);
-    else
-        bounds.origin.y = fmin(NSMaxY(docRect) - NSHeight(bounds) + inset, 
NSMaxY(bounds) - inset - 10.0);
-    [clipView scrollToPoint:bounds.origin];
-    [scrollView reflectScrolledClipView:clipView];
-}
-
-// PDFView scrolls by page with slightly more than the visible height
-// especially with (extra) contentInsets.
-// This really should be by slightly less than the visible height instead.
-// We should really override scrollPageUp:and scrollPageDown:,
-// but those are weirdly swapped in PDFView,
-// and we cannot be sure that will be true in the future.
-- (void)keyDown:(NSEvent *)theEvent {
-    unichar pageUpDown = 0;
-    
-    if (hasVerticalLayout(self)) {
-        pageUpDown = [theEvent firstCharacter];
-        NSUInteger modifiers = [theEvent standardModifierFlags];
-        if ((pageUpDown == SKSpaceCharacter) && ((modifiers & 
~NSEventModifierFlagShift) == 0))
-            pageUpDown = modifiers == NSEventModifierFlagShift ? 
NSPageUpFunctionKey : NSPageDownFunctionKey;
-        else if (modifiers != 0 || (pageUpDown != NSPageUpFunctionKey && 
pageUpDown != NSPageDownFunctionKey))
-            pageUpDown = 0;
-    }
-    
-    if (pageUpDown == NSPageDownFunctionKey)
-        [self verticallyScrollPageUp:self];
-    else if (pageUpDown == NSPageUpFunctionKey)
-        [self verticallyScrollPageDown:self];
-    else
-        [super keyDown:theEvent];
-}
-
 static inline CGRect SKPixelAlignedRect(CGRect rect, CGContextRef context) {
     CGRect r;
     rect = CGContextConvertRectToDeviceSpace(context, rect);

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

Reply via email to