Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private onToolbarItemSelected = async (toolbarItem: ToolbarItem): Promise => {
switch (toolbarItem.props.name) {
case ToolbarItemName.DrawRectangle:
this.setState({
selectionMode: SelectionMode.RECT,
editorMode: EditorMode.Rectangle,
});
break;
case ToolbarItemName.DrawPolygon:
this.setState({
selectionMode: SelectionMode.POLYGON,
editorMode: EditorMode.Polygon,
});
break;
case ToolbarItemName.CopyRectangle:
this.setState({
selectionMode: SelectionMode.COPYRECT,
editorMode: EditorMode.CopyRect,
});
break;
case ToolbarItemName.SelectCanvas:
this.setState({
selectionMode: SelectionMode.NONE,
editorMode: EditorMode.Select,
});
break;
case ToolbarItemName.PreviousAsset: