Revision: 15315
http://sourceforge.net/p/skim-app/code/15315
Author: hofman
Date: 2025-05-28 09:06:11 +0000 (Wed, 28 May 2025)
Log Message:
-----------
use viewDidChangeBackingProperties
Modified Paths:
--------------
trunk/SKPresentationView.m
Modified: trunk/SKPresentationView.m
===================================================================
--- trunk/SKPresentationView.m 2025-05-28 08:49:17 UTC (rev 15314)
+++ trunk/SKPresentationView.m 2025-05-28 09:06:11 UTC (rev 15315)
@@ -144,7 +144,10 @@
[super observeValueForKeyPath:keyPath ofObject:object change:change
context:context];
}
-- (void)handleWindowDidChangeBackingProperties:(NSNotification *)notifcation {
+- (void)viewDidChangeBackingProperties {
+ [super viewDidChangeBackingProperties];
+ if ([self window] == nil)
+ return;
CGFloat scale = [[self window] backingScaleFactor];
if (fabs([pageLayer contentsScale] - scale) > 0.0) {
[pageLayer setContentsScale:scale];
@@ -154,23 +157,6 @@
}
}
-- (void)viewWillMoveToWindow:(NSWindow *)newWindow {
- [super viewWillMoveToWindow:newWindow];
- NSWindow *window = [self window];
- if (window) {
- [[NSNotificationCenter defaultCenter] removeObserver:self
name:NSWindowDidChangeBackingPropertiesNotification object:window];
- }
-}
-
-- (void)viewDidMoveToWindow {
- [super viewDidMoveToWindow];
- NSWindow *window = [self window];
- if (window) {
- [self handleWindowDidChangeBackingProperties:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleWindowDidChangeBackingProperties:)
name:NSWindowDidChangeBackingPropertiesNotification object:window];
- }
-}
-
#pragma mark Transitions
- (void)displayPage:(PDFPage *)newPage completionHandler:(void
(^)(void))completionHandler {
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