[3d] bug fix and add loading for background image change (#3888)

This commit is contained in:
Terry Jia
2025-05-14 16:11:36 -04:00
committed by GitHub
parent e6d649b596
commit ebd9c96a28
2 changed files with 23 additions and 6 deletions

View File

@@ -82,6 +82,8 @@ export class SceneManager implements SceneManagerInterface {
}
async setBackgroundImage(uploadPath: string): Promise<void> {
this.eventManager.emitEvent('backgroundImageLoadingStart', null)
if (uploadPath === '') {
this.removeBackgroundImage()
return
@@ -123,7 +125,9 @@ export class SceneManager implements SceneManagerInterface {
)
this.eventManager.emitEvent('backgroundImageChange', uploadPath)
this.eventManager.emitEvent('backgroundImageLoadingEnd', null)
} catch (error) {
this.eventManager.emitEvent('backgroundImageLoadingEnd', null)
console.error('Error loading background image:', error)
}
}
@@ -139,6 +143,7 @@ export class SceneManager implements SceneManagerInterface {
this.backgroundTexture.dispose()
this.backgroundTexture = null
}
this.eventManager.emitEvent('backgroundImageLoadingEnd', null)
}
updateBackgroundSize(