Skip to content

Commit 27cae03

Browse files
committed
add accelerate fromJson
1 parent 20cf766 commit 27cae03

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

__TESTS__/unit/fromJson/effect.fromJson.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ describe('effect.fromJson', () => {
1616
{ actionType: 'oilPaint', level: 8 },
1717
{ actionType: 'cartoonify', colorReductionLevel: 80, lineStrength: 70 },
1818
{ actionType: 'outline', width: 100, color: 'lightblue' },
19-
{ actionType: 'blackwhite', level: 40 }
19+
{ actionType: 'blackwhite', level: 40 },
20+
{ actionType: 'accelerate'}
21+
2022
]);
2123

2224
expect(transformation.toString()).toStrictEqual([
@@ -33,7 +35,8 @@ describe('effect.fromJson', () => {
3335
'e_oil_paint:8',
3436
'e_cartoonify:70:80',
3537
'co_lightblue,e_outline:100',
36-
'e_blackwhite:40'
38+
'e_blackwhite:40',
39+
'e_accelerate'
3740
].join('/'));
3841
});
3942
});

src/internal/fromJson.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {EffectActionWithStrength} from "../actions/effect/EffectActions/EffectAc
2727
import {CartoonifyEffect} from "../actions/effect/Cartoonify.js";
2828
import {EffectOutline} from "../actions/effect/Outline.js";
2929
import {BlackwhiteEffectAction} from "../actions/effect/leveled/Blackwhite.js";
30+
import {AccelerationEffectAction} from "../actions/effect/leveled/Accelerate.js";
3031

3132
const ActionModelMap: Record<string, IHasFromJson> = {
3233
scale: ResizeScaleAction,
@@ -57,7 +58,8 @@ const ActionModelMap: Record<string, IHasFromJson> = {
5758
oilPaint: EffectActionWithStrength,
5859
cartoonify: CartoonifyEffect,
5960
outline: EffectOutline,
60-
blackwhite: BlackwhiteEffectAction
61+
blackwhite: BlackwhiteEffectAction,
62+
accelerate: AccelerationEffectAction
6163
};
6264

6365
/**

0 commit comments

Comments
 (0)