.../Source/Components/Popup/PopupBackgroundView.swift
Line  | Count  | Source  | 
1  |  | //  | 
2  |  | //  PopupBackgroundView.swift  | 
3  |  | //  CutBox  | 
4  |  | //  | 
5  |  | //  Created by Jason Milkins on 24/3/18.  | 
6  |  | //  Copyright © 2018-2023 ocodo. All rights reserved.  | 
7  |  | //  | 
8  |  |  | 
9  |  | import Cocoa  | 
10  |  |  | 
11  |  | public class PopupBackgroundView: CutBoxBaseView { | 
12  |  |     public var cornerRadius: CGFloat = 0  | 
13  | 179  |     public var backgroundColor = NSColor.clear  | 
14  |  |  | 
15  | 3  |     public override func draw(_ dirtyRect: NSRect) { | 
16  | 3  |         let contentRect = self.bounds  | 
17  | 3  |         let path = NSBezierPath()  | 
18  | 3  |         path.appendRoundedRect(contentRect, xRadius: cornerRadius, yRadius: cornerRadius)  | 
19  | 3  |         path.close()  | 
20  | 3  |         backgroundColor.setFill()  | 
21  | 3  |         path.fill()  | 
22  | 3  |     }  | 
23  |  | }  |