Skip to content

Commit 53dfb0c

Browse files
authored
Use fixed size rather than nsscreen (#174)
1 parent 3dc67e3 commit 53dfb0c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

DemoApp/DemoApp.xcodeproj/project.pbxproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,11 @@
829829
};
830830
FA8F8B802C66C4C4007CEA33 /* PBXTargetDependency */ = {
831831
isa = PBXTargetDependency;
832+
platformFilters = (
833+
ios,
834+
maccatalyst,
835+
macos,
836+
);
832837
target = FA1671BE2A5367A800A42DB0 /* DemoApp */;
833838
targetProxy = FA8F8B7F2C66C4C4007CEA33 /* PBXContainerItemProxy */;
834839
};
@@ -1245,6 +1250,8 @@
12451250
PRODUCT_BUNDLE_IDENTIFIER = com.emerge.DemoAppTests;
12461251
PRODUCT_NAME = "$(TARGET_NAME)";
12471252
SDKROOT = iphoneos;
1253+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
1254+
SUPPORTS_MACCATALYST = YES;
12481255
SWIFT_EMIT_LOC_STRINGS = NO;
12491256
SWIFT_VERSION = 5.0;
12501257
TARGETED_DEVICE_FAMILY = "1,2";
@@ -1265,6 +1272,8 @@
12651272
PRODUCT_BUNDLE_IDENTIFIER = com.emerge.DemoAppTests;
12661273
PRODUCT_NAME = "$(TARGET_NAME)";
12671274
SDKROOT = iphoneos;
1275+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
1276+
SUPPORTS_MACCATALYST = YES;
12681277
SWIFT_EMIT_LOC_STRINGS = NO;
12691278
SWIFT_VERSION = 5.0;
12701279
TARGETED_DEVICE_FAMILY = "1,2";

Sources/SnapshotPreviewsCore/AppKitRenderingStrategy.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ final class AppKitContainer: NSHostingController<EmergeModifierView> {
9999
heightAnchor = view.heightAnchor.constraint(equalToConstant: height)
100100
heightAnchor?.isActive = true
101101
default:
102-
let fittingSize = sizeThatFits(in: NSScreen.main!.frame.size)
102+
let fittingSize = sizeThatFits(in: NSSize(width: 800, height: 200))
103103
widthAnchor = view.widthAnchor.constraint(greaterThanOrEqualToConstant: fittingSize.width)
104104
widthAnchor?.isActive = true
105105
heightAnchor = view.heightAnchor.constraint(greaterThanOrEqualToConstant: fittingSize.height)

0 commit comments

Comments
 (0)