From 3e8e86f9df3261e4863c7a5400e3edd294a41bb9 Mon Sep 17 00:00:00 2001 From: ChangeSuger Date: Mon, 2 Feb 2026 00:10:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20exitDuration=20?= =?UTF-8?q?=E6=9C=AA=E6=AD=A3=E5=B8=B8=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/webgal/src/store/stageReducer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/webgal/src/store/stageReducer.ts b/packages/webgal/src/store/stageReducer.ts index 901c3624e..57e1ffe42 100644 --- a/packages/webgal/src/store/stageReducer.ts +++ b/packages/webgal/src/store/stageReducer.ts @@ -160,7 +160,7 @@ const stageSlice = createSlice({ const prev = state.animationSettings[index]; state.animationSettings.splice(index, 1); - if (prev.exitAnimationName) { + if (prev.exitAnimationName || prev.exitDuration !== undefined) { // 如果有退出动画设定,保留一个 -off 的设定 const prevTarget = `${action.payload}-off`; const prevSetting = { From caeab46abc0e5ddd3631d6f5c041fa4fc4e33ec1 Mon Sep 17 00:00:00 2001 From: ChangeSuger Date: Mon, 2 Feb 2026 00:21:16 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E5=8E=9F?= =?UTF-8?q?=E5=85=88=E7=9A=84=E6=8E=A8=E5=87=BA=E5=8A=A8=E7=94=BB=E8=AE=BE?= =?UTF-8?q?=E5=AE=9A=E5=88=A0=E9=99=A4=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webgal/src/Core/Modules/animationFunctions.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/webgal/src/Core/Modules/animationFunctions.ts b/packages/webgal/src/Core/Modules/animationFunctions.ts index bf9d167ae..f72cf0df5 100644 --- a/packages/webgal/src/Core/Modules/animationFunctions.ts +++ b/packages/webgal/src/Core/Modules/animationFunctions.ts @@ -91,18 +91,19 @@ export function getEnterExitAnimation( if (isBg) { duration = DEFAULT_BG_OUT_DURATION; } - duration = - webgalStore.getState().stage.animationSettings.find((setting) => setting.target === target)?.exitDuration ?? - duration; + const animationSettings = webgalStore + .getState() + .stage.animationSettings.find((setting) => setting.target === target); + duration = animationSettings?.exitDuration ?? duration; // 走默认动画 let animation: IAnimationObject | null = generateUniversalSoftOffAnimationObj(realTarget ?? target, duration); - const animationName = webgalStore - .getState() - .stage.animationSettings.find((setting) => setting.target === target)?.exitAnimationName; + const animationName = animationSettings?.exitAnimationName; if (animationName) { logger.debug('取代默认退出动画', target); animation = getAnimationObject(animationName, realTarget ?? target, getAnimateDuration(animationName), false); duration = getAnimateDuration(animationName); + } + if (animationSettings) { // 退出动画拿完后,删了这个设定 webgalStore.dispatch(stageActions.removeAnimationSettingsByTargetOff(target)); logger.debug('删除退出动画设定', target);