Skip to content

Commit

Permalink
Made raster happen on MainActor
Browse files Browse the repository at this point in the history
  • Loading branch information
alexito4 committed Dec 14, 2022
1 parent fe77d24 commit 1d91276
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions Sources/Raster/Raster.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import AppKit
import SwiftUI

@MainActor
extension View {
public func rasterizeBitmap(at size: CGSize) -> NSBitmapImageRep {
let nsView = NSHostingView(rootView: self.frame(width: size.width, height: size.height))
Expand Down
3 changes: 2 additions & 1 deletion Tests/RasterTests/RasterTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import XCTest
import SnapshotTesting
import SwiftUI

@MainActor
final class RasterTests: XCTestCase {
func testExample() throws {
func testExample() async throws {
let size = CGSize(width: 100, height: 100)
let view = ExampleView()
.frame(width: size.width, height: size.height, alignment: .center)
Expand Down

0 comments on commit 1d91276

Please sign in to comment.