in SAM2-Demo/Views/ZoomableScrollView.swift [20:36]
func makeNSView(context: Context) -> NSScrollView {
let scrollView = NSScrollView()
scrollView.hasVerticalScroller = true
scrollView.hasHorizontalScroller = true
scrollView.autohidesScrollers = true
scrollView.allowsMagnification = false
scrollView.maxMagnification = 20
scrollView.minMagnification = 1
let hostedView = context.coordinator.hostingView
hostedView.translatesAutoresizingMaskIntoConstraints = true
hostedView.autoresizingMask = [.width, .height]
hostedView.frame = scrollView.bounds
scrollView.documentView = hostedView
return scrollView
}