File tree 1 file changed +3
-5
lines changed
Sources/SnapshotTesting/Snapshotting
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ extension Snapshotting where Value == NSView, Format == NSImage {
31
31
32
32
let initialFrame = view. frame
33
33
if let size = size { view. frame. size = size }
34
+ view. layoutSubtreeIfNeeded ( )
34
35
guard view. frame. width > 0 , view. frame. height > 0 else {
35
36
fatalError ( " View not renderable to image at size \( view. frame. size) " )
36
37
}
@@ -72,11 +73,8 @@ extension Snapshotting where Value == NSView, Format == NSImage {
72
73
73
74
}
74
75
75
- // This is to maintain compatibility with `recursiveDescription` because the current
76
- // test snapshots expect `.needsLayout = false` and for some apple magic reason
77
- // `view.needsLayout = false` does not do anything, but this does.
78
- let bitmapRep2 = view. bitmapImageRepForCachingDisplay ( in: view. bounds) !
79
- view. cacheDisplay ( in: view. bounds, to: bitmapRep2)
76
+ // This is to maintain compatibility with `recursiveDescription`
77
+ view. layoutSubtreeIfNeeded ( )
80
78
}
81
79
82
80
}
You can’t perform that action at this time.
0 commit comments