Revision: 16474
          http://sourceforge.net/p/skim-app/code/16474
Author:   hofman
Date:     2026-09-14 14:40:43 +0000 (Mon, 14 Sep 2026)
Log Message:
-----------
temporarily set forced contentInsets in pdf scrollview during initial setup, 
otherwise layout will use zero insets and the page scrolls to the top of the 
view rather than the top of the unobscured view.

Modified Paths:
--------------
    trunk/SKMainWindowController.m

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2026-09-13 22:02:50 UTC (rev 16473)
+++ trunk/SKMainWindowController.m      2026-09-14 14:40:43 UTC (rev 16474)
@@ -434,6 +434,9 @@
         titleBarHeight = NSHeight([window frame]) - NSHeight([window 
contentLayoutRect]);
         [leftSideController setTopInset:titleBarHeight];
         [rightSideController setTopInset:titleBarHeight];
+        // temporarily force the contentInsets we will get, otherwise initial 
layout will use zero insets
+        [[pdfView embeddedScrollView] setAutomaticallyAdjustsContentInsets:NO];
+        [[pdfView embeddedScrollView] 
setContentInsets:NSEdgeInsetsMake(titleBarHeight, 0.0, 0.0, 0.0)];
     }
     
     [self setWindowFrameAutosaveNameOrCascade:SKMainWindowFrameAutosaveName];
@@ -520,9 +523,9 @@
     [centerContentView addSubview:view];
     [NSLayoutConstraint activateConstraints:constraints];
     
-    // contentInsets is not updated immediately, but is used by calculations 
in performFit: and goToSKDestination:
+    // revert to automatic contentInsets
     if (mwcFlags.fullSizeContent)
-        [[pdfView embeddedScrollView] 
setContentInsets:NSEdgeInsetsMake(titleBarHeight, 0.0, 0.0, 0.0)];
+        [[pdfView embeddedScrollView] 
setAutomaticallyAdjustsContentInsets:YES];
     
     if (hasWindowSetup == NO) {
         NSInteger windowSizeOption = [sud 
integerForKey:SKInitialWindowSizeOptionKey];

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