Layer selection (#166)

* Change arg to IconButton component

* Add basic layer selection mechanism

* Clean up print statements and add some comments

* Simplified the layer selection mechanism

* Remove redundant rule for 'no-param-reassign'

* Clean up frontend and and plumb selection flow to backend

* Update eslintrc

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
This commit is contained in:
akshay1992kalbhor
2021-06-10 00:10:51 +05:30
committed by GitHub
parent 8fa4b86d48
commit 981f138812
3 changed files with 88 additions and 3 deletions

View File

@@ -118,19 +118,30 @@ export interface LayerPanelEntry {
name: string;
visible: boolean;
layer_type: LayerType;
collapsed: boolean;
path: BigUint64Array;
layer_data: LayerData;
}
function newLayerPanelEntry(input: any): LayerPanelEntry {
return {
name: input.name,
visible: input.visible,
layer_type: newLayerType(input.layer_type),
collapsed: input.collapsed,
layer_data: newLayerData(input.layer_data),
path: new BigUint64Array(input.path.map((n: number) => BigInt(n))),
};
}
export interface LayerData {
expanded: boolean;
selected: boolean;
}
function newLayerData(input: any): LayerData {
return {
expanded: input.expanded,
selected: input.selected,
};
}
export enum LayerType {
Folder = "Folder",
Shape = "Shape",