import '../Selector.scss'; import * as React from 'react'; import { type IContainerModel } from '../../../../Interfaces/IContainerModel'; import { GetAbsolutePosition } from '../../../../utils/itertools'; import { RemoveMargin } from '../../../../utils/svg'; import { Selector } from '../Selector/Selector'; interface ISelectorContainerProps { containers: Map selected?: IContainerModel scale?: number } export function SelectorContainer(props: ISelectorContainerProps): JSX.Element { if (props.selected === undefined || props.selected === null) { return ( ); } const scale = (props.scale ?? 1); let [x, y] = GetAbsolutePosition(props.containers, props.selected); let [width, height] = [ props.selected.properties.width, props.selected.properties.height ]; ({ x, y, width, height } = RemoveMargin(x, y, width, height, props.selected.properties.margin.left, props.selected.properties.margin.bottom, props.selected.properties.margin.top, props.selected.properties.margin.right )); return ( ); }