@@ -173,8 +173,8 @@ function mergeBrushSnapshot(target: BrushUISignal, source: BrushUISnapshot) {
173173 const sourceValue = source [ key ] ;
174174 const targetValue = ( target as any ) [ key ] ;
175175
176- // Deep merge for envelope1 object
177- if ( key === 'envelope1 ' && sourceValue && typeof sourceValue === 'object' && targetValue && typeof targetValue === 'object' ) {
176+ // Deep merge for envelope object
177+ if ( key === 'envelope ' && sourceValue && typeof sourceValue === 'object' && targetValue && typeof targetValue === 'object' ) {
178178 for ( const envKey of Object . keys ( sourceValue ) ) {
179179 targetValue [ envKey ] = sourceValue [ envKey ] ;
180180 }
@@ -571,13 +571,13 @@ export function applyPresetToBrush(
571571 brush . emitRate = presetProps . emitRate ?? 0.5 ;
572572 brush . particleLifetime = presetProps . particleLifetime ?? 0 ;
573573
574- if ( brush . envelope1 ) {
575- brush . envelope1 . attackTime = presetProps . envelope1 ?. attackTime ?? 0 ;
576- brush . envelope1 . attackOpacityDepth = presetProps . envelope1 ?. attackOpacityDepth ?? 0 ;
577- brush . envelope1 . attackSizeDepth = presetProps . envelope1 ?. attackSizeDepth ?? 0 ;
578- brush . envelope1 . decayOpacityDepth = presetProps . envelope1 ?. decayOpacityDepth ?? 0 ;
579- brush . envelope1 . decaySizeDepth = presetProps . envelope1 ?. decaySizeDepth ?? 0 ;
580- brush . envelope1 . curve = presetProps . envelope1 ?. curve ?? 0 ;
574+ if ( brush . envelope ) {
575+ brush . envelope . attackTime = presetProps . envelope ?. attackTime ?? 0 ;
576+ brush . envelope . attackOpacityDepth = presetProps . envelope ?. attackOpacityDepth ?? 0 ;
577+ brush . envelope . attackSizeDepth = presetProps . envelope ?. attackSizeDepth ?? 0 ;
578+ brush . envelope . decayOpacityDepth = presetProps . envelope ?. decayOpacityDepth ?? 0 ;
579+ brush . envelope . decaySizeDepth = presetProps . envelope ?. decaySizeDepth ?? 0 ;
580+ brush . envelope . curve = presetProps . envelope ?. curve ?? 0 ;
581581 }
582582
583583 if ( presetProps . gradientId && typeof presetProps . gradientId === "string" ) {
@@ -1445,14 +1445,14 @@ export const brushActions = {
14451445
14461446 updateEnvelopeProperty ( property : string , value : any ) {
14471447 const brush = currentBrush . value ;
1448- if ( ! brush || ! brush . envelope1 ) return ;
1448+ if ( ! brush || ! brush . envelope ) return ;
14491449
1450- ( brush . envelope1 as any ) [ property ] = value ;
1450+ ( brush . envelope as any ) [ property ] = value ;
14511451 brush . isDirty = true ;
14521452
14531453 const uiBrush = currentBrushState . value ;
1454- if ( uiBrush && uiBrush . envelope1 ) {
1455- ( uiBrush . envelope1 as any ) [ property ] = value ;
1454+ if ( uiBrush && uiBrush . envelope ) {
1455+ ( uiBrush . envelope as any ) [ property ] = value ;
14561456 uiBrush . isDirty = true ;
14571457 }
14581458 } ,
@@ -1985,13 +1985,13 @@ export const brushActions = {
19851985 ) || "Sine" ,
19861986 emitRate : brush . emitRate ,
19871987 particleLifetime : brush . particleLifetime ,
1988- envelope1 : brush . envelope1 ? {
1989- attackTime : brush . envelope1 . attackTime ,
1990- attackOpacityDepth : brush . envelope1 . attackOpacityDepth ,
1991- attackSizeDepth : brush . envelope1 . attackSizeDepth ,
1992- decayOpacityDepth : brush . envelope1 . decayOpacityDepth ,
1993- decaySizeDepth : brush . envelope1 . decaySizeDepth ,
1994- curve : brush . envelope1 . curve ,
1988+ envelope : brush . envelope ? {
1989+ attackTime : brush . envelope . attackTime ,
1990+ attackOpacityDepth : brush . envelope . attackOpacityDepth ,
1991+ attackSizeDepth : brush . envelope . attackSizeDepth ,
1992+ decayOpacityDepth : brush . envelope . decayOpacityDepth ,
1993+ decaySizeDepth : brush . envelope . decaySizeDepth ,
1994+ curve : brush . envelope . curve ,
19951995 } : undefined ,
19961996 drawOnMove : brush . drawOnMove ,
19971997 retriggerOnDraw : brush . retriggerOnDraw ,
0 commit comments