|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+import Cocoa
|
|
|
2
|
+
|
|
|
3
|
+enum QuickStartIconKind {
|
|
|
4
|
+ case photos
|
|
|
5
|
+ case files
|
|
|
6
|
+ case importFile
|
|
|
7
|
+}
|
|
|
8
|
+
|
|
|
9
|
+final class QuickStartIconView: NSView {
|
|
|
10
|
+ private let kind: QuickStartIconKind
|
|
|
11
|
+
|
|
|
12
|
+ init(kind: QuickStartIconKind) {
|
|
|
13
|
+ self.kind = kind
|
|
|
14
|
+ super.init(frame: .zero)
|
|
|
15
|
+ translatesAutoresizingMaskIntoConstraints = false
|
|
|
16
|
+ }
|
|
|
17
|
+
|
|
|
18
|
+ @available(*, unavailable)
|
|
|
19
|
+ required init?(coder: NSCoder) { nil }
|
|
|
20
|
+
|
|
|
21
|
+ override var isFlipped: Bool { true }
|
|
|
22
|
+ override var isOpaque: Bool { false }
|
|
|
23
|
+
|
|
|
24
|
+ override func draw(_ dirtyRect: NSRect) {
|
|
|
25
|
+ super.draw(dirtyRect)
|
|
|
26
|
+ guard let context = NSGraphicsContext.current?.cgContext else { return }
|
|
|
27
|
+
|
|
|
28
|
+ switch kind {
|
|
|
29
|
+ case .photos:
|
|
|
30
|
+ drawPhotosIcon(in: context)
|
|
|
31
|
+ case .files:
|
|
|
32
|
+ drawFilesIcon(in: context)
|
|
|
33
|
+ case .importFile:
|
|
|
34
|
+ drawImportIcon(in: context)
|
|
|
35
|
+ }
|
|
|
36
|
+ }
|
|
|
37
|
+
|
|
|
38
|
+ // MARK: - Photos
|
|
|
39
|
+
|
|
|
40
|
+ private func drawPhotosIcon(in context: CGContext) {
|
|
|
41
|
+ let s = min(bounds.width, bounds.height)
|
|
|
42
|
+ let ox = (bounds.width - s) / 2
|
|
|
43
|
+ let oy = (bounds.height - s) / 2
|
|
|
44
|
+
|
|
|
45
|
+ drawSoftShadow(in: context, rect: CGRect(x: ox + s * 0.30, y: oy + s * 0.52, width: s * 0.50, height: s * 0.08), radius: s * 0.04)
|
|
|
46
|
+
|
|
|
47
|
+ context.saveGState()
|
|
|
48
|
+ context.translateBy(x: ox + s * 0.62, y: oy + s * 0.30)
|
|
|
49
|
+ context.rotate(by: .pi / 7.5)
|
|
|
50
|
+ context.translateBy(x: -(s * 0.24), y: -(s * 0.28))
|
|
|
51
|
+
|
|
|
52
|
+ let backRect = CGRect(x: 0, y: 0, width: s * 0.48, height: s * 0.56)
|
|
|
53
|
+ let backPath = roundedRect(backRect, radius: s * 0.085)
|
|
|
54
|
+ context.setFillColor(NSColor.white.withAlphaComponent(0.92).cgColor)
|
|
|
55
|
+ context.addPath(backPath)
|
|
|
56
|
+ context.fillPath()
|
|
|
57
|
+
|
|
|
58
|
+ context.setStrokeColor(NSColor.white.cgColor)
|
|
|
59
|
+ context.setLineWidth(s * 0.014)
|
|
|
60
|
+ context.addPath(backPath)
|
|
|
61
|
+ context.strokePath()
|
|
|
62
|
+
|
|
|
63
|
+ drawMountainScene(
|
|
|
64
|
+ in: context,
|
|
|
65
|
+ rect: CGRect(x: backRect.minX + s * 0.05, y: backRect.minY + s * 0.07, width: backRect.width - s * 0.10, height: backRect.height - s * 0.12),
|
|
|
66
|
+ sunColor: NSColor(red: 0.62, green: 0.86, blue: 0.95, alpha: 1),
|
|
|
67
|
+ mountainColor: NSColor(red: 0.38, green: 0.80, blue: 0.90, alpha: 1)
|
|
|
68
|
+ )
|
|
|
69
|
+ context.restoreGState()
|
|
|
70
|
+
|
|
|
71
|
+ let frontRect = CGRect(x: ox + s * 0.20, y: oy + s * 0.22, width: s * 0.50, height: s * 0.58)
|
|
|
72
|
+ let frontPath = roundedRect(frontRect, radius: s * 0.085)
|
|
|
73
|
+
|
|
|
74
|
+ let blueTop = NSColor(red: 0.34, green: 0.62, blue: 1.0, alpha: 1)
|
|
|
75
|
+ let blueBottom = NSColor(red: 0.16, green: 0.40, blue: 0.94, alpha: 1)
|
|
|
76
|
+ fillGradient(in: context, path: frontPath, colors: [blueTop.cgColor, blueBottom.cgColor], start: CGPoint(x: frontRect.midX, y: frontRect.minY), end: CGPoint(x: frontRect.midX, y: frontRect.maxY))
|
|
|
77
|
+
|
|
|
78
|
+ drawMountainScene(
|
|
|
79
|
+ in: context,
|
|
|
80
|
+ rect: CGRect(x: frontRect.minX + s * 0.05, y: frontRect.minY + s * 0.07, width: frontRect.width - s * 0.10, height: frontRect.height - s * 0.12),
|
|
|
81
|
+ sunColor: .white,
|
|
|
82
|
+ mountainColor: .white
|
|
|
83
|
+ )
|
|
|
84
|
+
|
|
|
85
|
+ context.setStrokeColor(NSColor.white.withAlphaComponent(0.4).cgColor)
|
|
|
86
|
+ context.setLineWidth(s * 0.01)
|
|
|
87
|
+ context.addPath(frontPath)
|
|
|
88
|
+ context.strokePath()
|
|
|
89
|
+ }
|
|
|
90
|
+
|
|
|
91
|
+ private func drawMountainScene(in context: CGContext, rect: CGRect, sunColor: NSColor, mountainColor: NSColor) {
|
|
|
92
|
+ let sunRadius = rect.width * 0.09
|
|
|
93
|
+ context.setFillColor(sunColor.cgColor)
|
|
|
94
|
+ context.fillEllipse(in: CGRect(x: rect.minX + rect.width * 0.10, y: rect.minY + rect.height * 0.08, width: sunRadius * 2, height: sunRadius * 2))
|
|
|
95
|
+
|
|
|
96
|
+ let baseY = rect.maxY - rect.height * 0.10
|
|
|
97
|
+ context.setFillColor(mountainColor.cgColor)
|
|
|
98
|
+ let leftPeak = mountainPath(
|
|
|
99
|
+ baseY: baseY,
|
|
|
100
|
+ peakX: rect.minX + rect.width * 0.22,
|
|
|
101
|
+ peakY: rect.minY + rect.height * 0.48,
|
|
|
102
|
+ leftX: rect.minX,
|
|
|
103
|
+ rightX: rect.minX + rect.width * 0.48
|
|
|
104
|
+ )
|
|
|
105
|
+ context.addPath(leftPeak)
|
|
|
106
|
+ context.fillPath()
|
|
|
107
|
+
|
|
|
108
|
+ let rightPeak = mountainPath(
|
|
|
109
|
+ baseY: baseY,
|
|
|
110
|
+ peakX: rect.minX + rect.width * 0.72,
|
|
|
111
|
+ peakY: rect.minY + rect.height * 0.62,
|
|
|
112
|
+ leftX: rect.minX + rect.width * 0.34,
|
|
|
113
|
+ rightX: rect.maxX
|
|
|
114
|
+ )
|
|
|
115
|
+ context.addPath(rightPeak)
|
|
|
116
|
+ context.fillPath()
|
|
|
117
|
+ }
|
|
|
118
|
+
|
|
|
119
|
+ // MARK: - Files
|
|
|
120
|
+
|
|
|
121
|
+ private func drawFilesIcon(in context: CGContext) {
|
|
|
122
|
+ let s = min(bounds.width, bounds.height)
|
|
|
123
|
+ let ox = (bounds.width - s) / 2
|
|
|
124
|
+ let oy = (bounds.height - s) / 2
|
|
|
125
|
+
|
|
|
126
|
+ let folderRect = CGRect(x: ox + s * 0.10, y: oy + s * 0.28, width: s * 0.78, height: s * 0.52)
|
|
|
127
|
+ drawSoftShadow(in: context, rect: CGRect(x: folderRect.minX, y: folderRect.maxY - s * 0.04, width: folderRect.width, height: s * 0.06), radius: s * 0.03)
|
|
|
128
|
+
|
|
|
129
|
+ let backGreen = NSColor(red: 0.42, green: 0.80, blue: 0.36, alpha: 1)
|
|
|
130
|
+ let frontGreen = NSColor(red: 0.62, green: 0.92, blue: 0.44, alpha: 1)
|
|
|
131
|
+
|
|
|
132
|
+ let tabRect = CGRect(x: folderRect.minX + s * 0.02, y: folderRect.minY - s * 0.08, width: s * 0.30, height: s * 0.10)
|
|
|
133
|
+ context.setFillColor(backGreen.cgColor)
|
|
|
134
|
+ context.addPath(roundedRect(tabRect, radius: s * 0.025, topLeft: s * 0.025, topRight: s * 0.025, bottomLeft: 0, bottomRight: 0))
|
|
|
135
|
+ context.fillPath()
|
|
|
136
|
+
|
|
|
137
|
+ let backBody = CGRect(x: folderRect.minX, y: folderRect.minY, width: folderRect.width, height: folderRect.height)
|
|
|
138
|
+ fillGradient(in: context, path: roundedRect(backBody, radius: s * 0.055), colors: [backGreen.cgColor, NSColor(red: 0.24, green: 0.66, blue: 0.28, alpha: 1).cgColor], start: CGPoint(x: backBody.midX, y: backBody.minY), end: CGPoint(x: backBody.midX, y: backBody.maxY))
|
|
|
139
|
+
|
|
|
140
|
+ let docBack = CGRect(x: folderRect.minX + s * 0.14, y: folderRect.minY - s * 0.18, width: s * 0.32, height: s * 0.40)
|
|
|
141
|
+ context.setFillColor(NSColor.white.withAlphaComponent(0.85).cgColor)
|
|
|
142
|
+ context.addPath(roundedRect(docBack, radius: s * 0.02))
|
|
|
143
|
+ context.fillPath()
|
|
|
144
|
+
|
|
|
145
|
+ let docFront = CGRect(x: folderRect.minX + s * 0.22, y: folderRect.minY - s * 0.28, width: s * 0.40, height: s * 0.50)
|
|
|
146
|
+ context.setFillColor(NSColor.white.cgColor)
|
|
|
147
|
+ context.addPath(roundedRect(docFront, radius: s * 0.03))
|
|
|
148
|
+ context.fillPath()
|
|
|
149
|
+
|
|
|
150
|
+ let header = CGRect(x: docFront.minX, y: docFront.minY, width: docFront.width, height: s * 0.12)
|
|
|
151
|
+ context.setFillColor(NSColor(red: 0.20, green: 0.48, blue: 0.96, alpha: 1).cgColor)
|
|
|
152
|
+ context.addPath(roundedRect(header, radius: s * 0.03, topLeft: s * 0.03, topRight: s * 0.03, bottomLeft: 0, bottomRight: 0))
|
|
|
153
|
+ context.fillPath()
|
|
|
154
|
+
|
|
|
155
|
+ let lineColor = NSColor(red: 0.66, green: 0.74, blue: 0.98, alpha: 1)
|
|
|
156
|
+ for (index, widthFactor) in [0.78, 0.62, 0.70].enumerated() {
|
|
|
157
|
+ let lineY = docFront.minY + s * 0.18 + CGFloat(index) * s * 0.075
|
|
|
158
|
+ let lineRect = CGRect(x: docFront.minX + s * 0.06, y: lineY, width: docFront.width * widthFactor - s * 0.08, height: s * 0.038)
|
|
|
159
|
+ context.setFillColor(lineColor.cgColor)
|
|
|
160
|
+ context.addPath(roundedRect(lineRect, radius: s * 0.014))
|
|
|
161
|
+ context.fillPath()
|
|
|
162
|
+ }
|
|
|
163
|
+
|
|
|
164
|
+ let frontFlap = CGRect(x: folderRect.minX, y: folderRect.minY + folderRect.height * 0.38, width: folderRect.width, height: folderRect.height * 0.62)
|
|
|
165
|
+ fillGradient(in: context, path: roundedRect(frontFlap, radius: s * 0.055, topLeft: 0, topRight: 0, bottomLeft: s * 0.055, bottomRight: s * 0.055), colors: [frontGreen.cgColor, NSColor(red: 0.38, green: 0.76, blue: 0.32, alpha: 1).cgColor], start: CGPoint(x: frontFlap.midX, y: frontFlap.minY), end: CGPoint(x: frontFlap.midX, y: frontFlap.maxY))
|
|
|
166
|
+ }
|
|
|
167
|
+
|
|
|
168
|
+ // MARK: - Import
|
|
|
169
|
+
|
|
|
170
|
+ private func drawImportIcon(in context: CGContext) {
|
|
|
171
|
+ let s = min(bounds.width, bounds.height)
|
|
|
172
|
+ let ox = (bounds.width - s) / 2
|
|
|
173
|
+ let oy = (bounds.height - s) / 2
|
|
|
174
|
+
|
|
|
175
|
+ let folderRect = CGRect(x: ox + s * 0.08, y: oy + s * 0.30, width: s * 0.74, height: s * 0.46)
|
|
|
176
|
+ drawSoftShadow(in: context, rect: CGRect(x: folderRect.minX, y: folderRect.maxY - s * 0.03, width: folderRect.width, height: s * 0.05), radius: s * 0.025)
|
|
|
177
|
+
|
|
|
178
|
+ let orangeTop = NSColor(red: 1.0, green: 0.84, blue: 0.40, alpha: 1)
|
|
|
179
|
+ let orangeBottom = NSColor(red: 0.95, green: 0.60, blue: 0.16, alpha: 1)
|
|
|
180
|
+
|
|
|
181
|
+ let tabRect = CGRect(x: folderRect.minX + s * 0.02, y: folderRect.minY - s * 0.07, width: s * 0.28, height: s * 0.09)
|
|
|
182
|
+ context.setFillColor(orangeBottom.cgColor)
|
|
|
183
|
+ context.addPath(roundedRect(tabRect, radius: s * 0.022, topLeft: s * 0.022, topRight: s * 0.022, bottomLeft: 0, bottomRight: 0))
|
|
|
184
|
+ context.fillPath()
|
|
|
185
|
+
|
|
|
186
|
+ fillGradient(in: context, path: roundedRect(folderRect, radius: s * 0.048), colors: [orangeTop.cgColor, orangeBottom.cgColor], start: CGPoint(x: folderRect.midX, y: folderRect.minY), end: CGPoint(x: folderRect.midX, y: folderRect.maxY))
|
|
|
187
|
+
|
|
|
188
|
+ let paper = CGRect(x: folderRect.minX + s * 0.12, y: folderRect.minY + s * 0.08, width: folderRect.width * 0.76, height: folderRect.height * 0.38)
|
|
|
189
|
+ context.setFillColor(NSColor.white.withAlphaComponent(0.9).cgColor)
|
|
|
190
|
+ context.addPath(roundedRect(paper, radius: s * 0.018))
|
|
|
191
|
+ context.fillPath()
|
|
|
192
|
+
|
|
|
193
|
+ let frontFlap = CGRect(x: folderRect.minX, y: folderRect.minY + folderRect.height * 0.42, width: folderRect.width, height: folderRect.height * 0.58)
|
|
|
194
|
+ fillGradient(in: context, path: roundedRect(frontFlap, radius: s * 0.048, topLeft: 0, topRight: 0, bottomLeft: s * 0.048, bottomRight: s * 0.048), colors: [NSColor(red: 1.0, green: 0.90, blue: 0.50, alpha: 1).cgColor, orangeBottom.cgColor], start: CGPoint(x: frontFlap.midX, y: frontFlap.minY), end: CGPoint(x: frontFlap.midX, y: frontFlap.maxY))
|
|
|
195
|
+
|
|
|
196
|
+ let badgeRadius = s * 0.17
|
|
|
197
|
+ let badgeCenter = CGPoint(x: folderRect.midX, y: folderRect.maxY - s * 0.02)
|
|
|
198
|
+ drawSoftShadow(in: context, rect: CGRect(x: badgeCenter.x - badgeRadius, y: badgeCenter.y - badgeRadius * 0.4, width: badgeRadius * 2, height: badgeRadius * 0.5), radius: s * 0.03)
|
|
|
199
|
+
|
|
|
200
|
+ let badgeRect = CGRect(x: badgeCenter.x - badgeRadius, y: badgeCenter.y - badgeRadius, width: badgeRadius * 2, height: badgeRadius * 2)
|
|
|
201
|
+ let badgeColors = [NSColor(red: 0.66, green: 0.78, blue: 1.0, alpha: 1).cgColor, NSColor(red: 0.40, green: 0.56, blue: 0.96, alpha: 1).cgColor]
|
|
|
202
|
+ fillGradient(in: context, path: CGPath(ellipseIn: badgeRect, transform: nil), colors: badgeColors, start: CGPoint(x: badgeRect.midX, y: badgeRect.minY), end: CGPoint(x: badgeRect.midX, y: badgeRect.maxY))
|
|
|
203
|
+
|
|
|
204
|
+ drawCloudUpload(in: context, center: badgeCenter, size: badgeRadius * 1.15)
|
|
|
205
|
+ }
|
|
|
206
|
+
|
|
|
207
|
+ private func drawCloudUpload(in context: CGContext, center: CGPoint, size: CGFloat) {
|
|
|
208
|
+ let cloudColor = NSColor.white
|
|
|
209
|
+ let arrowColor = NSColor(red: 0.28, green: 0.42, blue: 0.86, alpha: 1)
|
|
|
210
|
+
|
|
|
211
|
+ let w = size
|
|
|
212
|
+ let h = size * 0.62
|
|
|
213
|
+ let cloudRect = CGRect(x: center.x - w / 2, y: center.y - h / 2 + size * 0.04, width: w, height: h)
|
|
|
214
|
+ let cloud = cloudPath(in: cloudRect)
|
|
|
215
|
+ context.setFillColor(cloudColor.cgColor)
|
|
|
216
|
+ context.addPath(cloud)
|
|
|
217
|
+ context.fillPath()
|
|
|
218
|
+
|
|
|
219
|
+ let arrowWidth = size * 0.14
|
|
|
220
|
+ let arrowHeight = size * 0.28
|
|
|
221
|
+ let arrowTop = center.y + size * 0.02
|
|
|
222
|
+ let arrow = CGMutablePath()
|
|
|
223
|
+ arrow.move(to: CGPoint(x: center.x, y: arrowTop + arrowHeight))
|
|
|
224
|
+ arrow.addLine(to: CGPoint(x: center.x - arrowWidth, y: arrowTop + arrowHeight * 0.45))
|
|
|
225
|
+ arrow.addLine(to: CGPoint(x: center.x - arrowWidth * 0.45, y: arrowTop + arrowHeight * 0.45))
|
|
|
226
|
+ arrow.addLine(to: CGPoint(x: center.x - arrowWidth * 0.45, y: arrowTop))
|
|
|
227
|
+ arrow.addLine(to: CGPoint(x: center.x + arrowWidth * 0.45, y: arrowTop))
|
|
|
228
|
+ arrow.addLine(to: CGPoint(x: center.x + arrowWidth * 0.45, y: arrowTop + arrowHeight * 0.45))
|
|
|
229
|
+ arrow.addLine(to: CGPoint(x: center.x + arrowWidth, y: arrowTop + arrowHeight * 0.45))
|
|
|
230
|
+ arrow.closeSubpath()
|
|
|
231
|
+ context.setFillColor(arrowColor.cgColor)
|
|
|
232
|
+ context.addPath(arrow)
|
|
|
233
|
+ context.fillPath()
|
|
|
234
|
+ }
|
|
|
235
|
+
|
|
|
236
|
+ // MARK: - Helpers
|
|
|
237
|
+
|
|
|
238
|
+ private func drawSoftShadow(in context: CGContext, rect: CGRect, radius: CGFloat) {
|
|
|
239
|
+ context.saveGState()
|
|
|
240
|
+ context.setFillColor(NSColor.black.withAlphaComponent(0.12).cgColor)
|
|
|
241
|
+ context.addPath(roundedRect(rect.offsetBy(dx: 0, dy: -radius * 0.3), radius: radius))
|
|
|
242
|
+ context.fillPath()
|
|
|
243
|
+ context.restoreGState()
|
|
|
244
|
+ }
|
|
|
245
|
+
|
|
|
246
|
+ private func fillGradient(in context: CGContext, path: CGPath, colors: [CGColor], start: CGPoint, end: CGPoint) {
|
|
|
247
|
+ context.saveGState()
|
|
|
248
|
+ context.addPath(path)
|
|
|
249
|
+ context.clip()
|
|
|
250
|
+ guard let gradient = CGGradient(colorsSpace: CGColorSpaceCreateDeviceRGB(), colors: colors as CFArray, locations: [0, 1]) else {
|
|
|
251
|
+ context.restoreGState()
|
|
|
252
|
+ return
|
|
|
253
|
+ }
|
|
|
254
|
+ context.drawLinearGradient(gradient, start: start, end: end, options: [])
|
|
|
255
|
+ context.restoreGState()
|
|
|
256
|
+ }
|
|
|
257
|
+
|
|
|
258
|
+ private func roundedRect(_ rect: CGRect, radius: CGFloat) -> CGPath {
|
|
|
259
|
+ roundedRect(rect, radius: radius, topLeft: radius, topRight: radius, bottomLeft: radius, bottomRight: radius)
|
|
|
260
|
+ }
|
|
|
261
|
+
|
|
|
262
|
+ private func roundedRect(_ rect: CGRect, radius: CGFloat, topLeft: CGFloat, topRight: CGFloat, bottomLeft: CGFloat, bottomRight: CGFloat) -> CGPath {
|
|
|
263
|
+ let path = CGMutablePath()
|
|
|
264
|
+ path.move(to: CGPoint(x: rect.minX + topLeft, y: rect.maxY))
|
|
|
265
|
+ path.addLine(to: CGPoint(x: rect.maxX - topRight, y: rect.maxY))
|
|
|
266
|
+ path.addQuadCurve(to: CGPoint(x: rect.maxX, y: rect.maxY - topRight), control: CGPoint(x: rect.maxX, y: rect.maxY))
|
|
|
267
|
+ path.addLine(to: CGPoint(x: rect.maxX, y: rect.minY + bottomRight))
|
|
|
268
|
+ path.addQuadCurve(to: CGPoint(x: rect.maxX - bottomRight, y: rect.minY), control: CGPoint(x: rect.maxX, y: rect.minY))
|
|
|
269
|
+ path.addLine(to: CGPoint(x: rect.minX + bottomLeft, y: rect.minY))
|
|
|
270
|
+ path.addQuadCurve(to: CGPoint(x: rect.minX, y: rect.minY + bottomLeft), control: CGPoint(x: rect.minX, y: rect.minY))
|
|
|
271
|
+ path.addLine(to: CGPoint(x: rect.minX, y: rect.maxY - topLeft))
|
|
|
272
|
+ path.addQuadCurve(to: CGPoint(x: rect.minX + topLeft, y: rect.maxY), control: CGPoint(x: rect.minX, y: rect.maxY))
|
|
|
273
|
+ path.closeSubpath()
|
|
|
274
|
+ return path
|
|
|
275
|
+ }
|
|
|
276
|
+
|
|
|
277
|
+ private func mountainPath(baseY: CGFloat, peakX: CGFloat, peakY: CGFloat, leftX: CGFloat, rightX: CGFloat) -> CGPath {
|
|
|
278
|
+ let path = CGMutablePath()
|
|
|
279
|
+ path.move(to: CGPoint(x: leftX, y: baseY))
|
|
|
280
|
+ path.addLine(to: CGPoint(x: peakX, y: peakY))
|
|
|
281
|
+ path.addLine(to: CGPoint(x: rightX, y: baseY))
|
|
|
282
|
+ path.closeSubpath()
|
|
|
283
|
+ return path
|
|
|
284
|
+ }
|
|
|
285
|
+
|
|
|
286
|
+ private func cloudPath(in rect: CGRect) -> CGPath {
|
|
|
287
|
+ let path = CGMutablePath()
|
|
|
288
|
+ let r = rect.height * 0.38
|
|
|
289
|
+ path.addEllipse(in: CGRect(x: rect.minX + rect.width * 0.08, y: rect.minY + rect.height * 0.18, width: r * 2, height: r * 2))
|
|
|
290
|
+ path.addEllipse(in: CGRect(x: rect.minX + rect.width * 0.30, y: rect.minY + rect.height * 0.30, width: r * 2.1, height: r * 2.1))
|
|
|
291
|
+ path.addEllipse(in: CGRect(x: rect.minX + rect.width * 0.52, y: rect.minY + rect.height * 0.16, width: r * 1.9, height: r * 1.9))
|
|
|
292
|
+ path.addRect(CGRect(x: rect.minX + rect.width * 0.12, y: rect.minY + rect.height * 0.18, width: rect.width * 0.76, height: rect.height * 0.42))
|
|
|
293
|
+ return path
|
|
|
294
|
+ }
|
|
|
295
|
+}
|