|
|
|
@ -1,16 +1,17 @@
|
|
|
|
|
import { IConfigStore } from "../../UI/Store/BoardStore";
|
|
|
|
|
import { observable, toJS } from "mobx";
|
|
|
|
|
import { ISmoothEdgeOption, IUiOption } from "../../UI/Store/BoardInterface";
|
|
|
|
|
import { IConfigOption } from "../../UI/Components/Board/UserConfig";
|
|
|
|
|
import { DataAdapter } from "../../Common/DataAdapter";
|
|
|
|
|
import { IConfigOption } from "../../UI/Components/Board/UserConfig";
|
|
|
|
|
import { ISmoothEdgeOption, IUiOption } from "../../UI/Store/BoardInterface";
|
|
|
|
|
import { IConfigStore } from "../../UI/Store/BoardStore";
|
|
|
|
|
|
|
|
|
|
export class SmoothEdgeStore implements IConfigStore
|
|
|
|
|
{
|
|
|
|
|
@observable option: ISmoothEdgeOption = {
|
|
|
|
|
version: 1,
|
|
|
|
|
smoothEdge: 0,
|
|
|
|
|
edge: 0,
|
|
|
|
|
scale: 5,
|
|
|
|
|
filterArr: new Array(10).fill(""),
|
|
|
|
|
filterArr: new Array(20).fill(""),
|
|
|
|
|
};
|
|
|
|
|
@observable uiOption: IUiOption<ISmoothEdgeOption>;
|
|
|
|
|
configName = "default";
|
|
|
|
@ -18,10 +19,11 @@ export class SmoothEdgeStore implements IConfigStore
|
|
|
|
|
InitOption()
|
|
|
|
|
{
|
|
|
|
|
Object.assign(this.option, {
|
|
|
|
|
version: 1,
|
|
|
|
|
smoothEdge: 0,
|
|
|
|
|
edge: 0,
|
|
|
|
|
scale: 5,
|
|
|
|
|
filterArr: new Array(10).fill(""),
|
|
|
|
|
filterArr: new Array(20).fill(""),
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
get UiOption()
|
|
|
|
@ -39,6 +41,11 @@ export class SmoothEdgeStore implements IConfigStore
|
|
|
|
|
}
|
|
|
|
|
UpdateOption(cof: IConfigOption<ISmoothEdgeOption>)
|
|
|
|
|
{
|
|
|
|
|
if (!cof.option.version)
|
|
|
|
|
{
|
|
|
|
|
cof.option.version = 1;
|
|
|
|
|
cof.option.filterArr.push(...(new Array(10).fill("")));
|
|
|
|
|
}
|
|
|
|
|
Object.assign(this.option, cof.option);
|
|
|
|
|
if (this.uiOption)
|
|
|
|
|
Object.assign(this.uiOption, DataAdapter.ConvertUIData(cof.option));
|
|
|
|
|