Separated the model and the Container entity in order to remove any mutation operation
This commit is contained in:
parent
964d9a0e57
commit
e2a099457c
7 changed files with 206 additions and 178 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue