Separated the model and the Container entity in order to remove any mutation operation
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
Siklos 2022-08-04 12:57:34 +02:00
parent 964d9a0e57
commit e2a099457c
7 changed files with 206 additions and 178 deletions

View file

@ -1,8 +1,8 @@
import * as React from 'react';
import { Container } from './Container';
import { IContainerModel, getAbsolutePosition } from './ContainerModel';
interface ISelectorProps {
selected: Container | null
selected: IContainerModel | null
}
export const Selector: React.FC<ISelectorProps> = (props) => {
@ -13,10 +13,10 @@ export const Selector: React.FC<ISelectorProps> = (props) => {
);
}
const [x, y] = props.selected.getAbsolutePosition();
const [x, y] = getAbsolutePosition(props.selected);
const [width, height] = [
props.selected.props.properties.width,
props.selected.props.properties.height
props.selected.properties.width,
props.selected.properties.height
];
const style = {
stroke: '#3B82F6', // tw blue-500