From 392143a84250df3742bc2f52d358fec25877e4de Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 6 Feb 2025 14:54:13 -0500 Subject: from last - fixes to showing ease funcs/preview only when appropriate. --- src/client/views/nodes/trails/PresBox.tsx | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx index 28afe1df4..7c23ca8e1 100644 --- a/src/client/views/nodes/trails/PresBox.tsx +++ b/src/client/views/nodes/trails/PresBox.tsx @@ -153,6 +153,10 @@ export class PresBox extends ViewBoxBaseComponent() { this.setEaseFunc(this.activeItem, `cubic-bezier(${newPoints.p1[0]}, ${newPoints.p1[1]}, ${newPoints.p2[0]}, ${newPoints.p2[1]})`); }); + @computed get showEaseFunctions() { + return ![PresMovement.None, PresMovement.Jump, ''].includes(StrCast(this.activeItem?.presentation_movement) as PresMovement); + } + @computed get currCPoints() { return EaseFuncToPoints(this.activeItem.presentation_easeFunc ? StrCast(this.activeItem.presentation_easeFunc) : 'ease'); @@ -1957,7 +1961,7 @@ export class PresBox extends ViewBoxBaseComponent() { {/* Easing function */} - {[PresMovement.None, PresMovement.Jump, ''].includes(StrCast(activeItem.presentation_movement) as PresMovement) ? null : ( + {!this.showEaseFunctions ? null : ( () { {/* Cubic bezier editor */} - {StrCast(activeItem.presentation_easeFunc).includes('cubic-bezier') && ( + {this.showEaseFunctions && StrCast(activeItem.presentation_easeFunc).includes('cubic-bezier') && (
@@ -2066,7 +2070,7 @@ export class PresBox extends ViewBoxBaseComponent() { )} - {effect !== PresEffect.Lightspeed && ( + {![PresEffect.Lightspeed, PresEffect.Fade, PresEffect.None, ''].includes(effect) && ( <> () {
e.stopPropagation()}> {/* prettier-ignore */} timingConfig && this.updateEffectTiming(activeItem, { ...timingConfig, type: SpringType.CUSTOM, stiffness: val as number })} - valueLabelDisplay="auto" - /> + value={timingConfig.stiffness} + onChange={(e, val) => timingConfig && this.updateEffectTiming(activeItem, { ...timingConfig, type: SpringType.CUSTOM, stiffness: val as number })} + valueLabelDisplay="auto" + />
@@ -2126,14 +2130,14 @@ export class PresBox extends ViewBoxBaseComponent() {
- {effect === PresEffect.None ? null : ( + {[PresEffect.None, PresEffect.Fade, ''].includes(effect) ? null : (