Skip to content

Commit d434957

Browse files
committed
Fix SunMiniCard afterSunset display and AtmosBackground noise texture visibility
- Fix SunMiniCard to show next sunrise after sunset instead of showing sunset again - Fix AtmosBackground noise texture alpha calculation by removing .rounded(.down)
1 parent 766f0ae commit d434957

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

example_projects/Weather/Weather/Views/Backgrounds/AtmosBackground.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ struct AtmosBackground: View {
7272
Canvas { context, size in
7373
for x in stride(from: 0, through: size.width, by: 18) {
7474
for y in stride(from: 0, through: size.height, by: 18) {
75-
let alpha = WeatherMetricHelpers.deterministicPercent(seed: Int(x + y), index: Int(x * 3 + y)).rounded(.down) * 0.006
75+
let alpha = WeatherMetricHelpers.deterministicPercent(seed: Int(x + y), index: Int(x * 3 + y)) * 0.006
7676
context.fill(
7777
Path(CGRect(x: x, y: y, width: 1, height: 1)),
7878
with: .color(.white.opacity(alpha))

example_projects/Weather/Weather/Views/Sections/SunMiniCard.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ struct SunMiniCard: View {
3434

3535
private var nextLabel: String {
3636
switch current.solarProgress {
37-
case .beforeSunrise:
37+
case .beforeSunrise, .afterSunset:
3838
"SUNRISE"
39-
case .daylight, .afterSunset:
39+
case .daylight:
4040
"SUNSET"
4141
}
4242
}
4343

4444
private var nextTime: String {
4545
switch current.solarProgress {
46-
case .beforeSunrise:
46+
case .beforeSunrise, .afterSunset:
4747
current.sunrise.fullClockLabel
48-
case .daylight, .afterSunset:
48+
case .daylight:
4949
current.sunset.fullClockLabel
5050
}
5151
}

0 commit comments

Comments
 (0)