Skip to content

Commit

Permalink
Use fixed size rather than nsscreen (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
noahsmartin authored Aug 22, 2024
1 parent 3dc67e3 commit 53dfb0c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions DemoApp/DemoApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,11 @@
};
FA8F8B802C66C4C4007CEA33 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
platformFilters = (
ios,
maccatalyst,
macos,
);
target = FA1671BE2A5367A800A42DB0 /* DemoApp */;
targetProxy = FA8F8B7F2C66C4C4007CEA33 /* PBXContainerItemProxy */;
};
Expand Down Expand Up @@ -1245,6 +1250,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.emerge.DemoAppTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
SUPPORTS_MACCATALYST = YES;
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -1265,6 +1272,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.emerge.DemoAppTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
SUPPORTS_MACCATALYST = YES;
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
2 changes: 1 addition & 1 deletion Sources/SnapshotPreviewsCore/AppKitRenderingStrategy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ final class AppKitContainer: NSHostingController<EmergeModifierView> {
heightAnchor = view.heightAnchor.constraint(equalToConstant: height)
heightAnchor?.isActive = true
default:
let fittingSize = sizeThatFits(in: NSScreen.main!.frame.size)
let fittingSize = sizeThatFits(in: NSSize(width: 800, height: 200))
widthAnchor = view.widthAnchor.constraint(greaterThanOrEqualToConstant: fittingSize.width)
widthAnchor?.isActive = true
heightAnchor = view.heightAnchor.constraint(greaterThanOrEqualToConstant: fittingSize.height)
Expand Down

0 comments on commit 53dfb0c

Please sign in to comment.