Fix PhET initial webpage to be on screen for html canvas calculations

This commit is contained in:
Balazs Perlaki-Horvath 2025-05-24 23:12:14 +02:00 committed by Kelson
parent 37432b0e26
commit 107b7edf0b

View File

@ -184,13 +184,15 @@ struct BrowserTab: View {
#endif #endif
} else { } else {
switch model.state { switch model.state {
case .loadingData: case .loadingData, .webPage:
ZStack {
LoadingDataView() LoadingDataView()
case .webPage(let isLoading): .opacity(model.state == .loadingData ? 1.0 : 0.0)
WebView(browser: browser) WebView(browser: browser)
.opacity(model.state == .loadingData ? 0.0 : 1.0)
.ignoresSafeArea() .ignoresSafeArea()
.overlay { .overlay {
if isLoading { if case .webPage(let isLoading) = model.state, isLoading {
LoadingProgressView() LoadingProgressView()
} }
} }
@ -205,6 +207,7 @@ struct BrowserTab: View {
} }
} }
#endif #endif
}
case .catalog(.fetching): case .catalog(.fetching):
FetchingCatalogView() FetchingCatalogView()
case .catalog(.list): case .catalog(.list):