Merged PR 216: Deprecate parent from IContainerModel for FindContainerById

This commit is contained in:
Eric Nguyen 2022-10-17 16:01:06 +00:00
parent d40cd8cf8e
commit b4eba6bb9b
19 changed files with 97 additions and 109 deletions

View file

@ -31,7 +31,7 @@ function GetDimensionsNodes(
max = -Infinity;
}
const absoluteX = GetAbsolutePosition(container)[0];
const absoluteX = GetAbsolutePosition(containers, container)[0];
const x = TransformX(absoluteX, container.properties.width, container.properties.positionReference);
lastY = container.properties.y + container.properties.height;
if (x < min) {

View file

@ -6,6 +6,7 @@ import { GetAbsolutePosition } from '../../../../utils/itertools';
import { RemoveMargin } from '../../../../utils/svg';
interface ISelectorProps {
containers: Map<string, IContainerModel>
selected?: IContainerModel
scale?: number
}
@ -19,7 +20,7 @@ export function Selector(props: ISelectorProps): JSX.Element {
}
const scale = (props.scale ?? 1);
let [x, y] = GetAbsolutePosition(props.selected);
let [x, y] = GetAbsolutePosition(props.containers, props.selected);
let [width, height] = [
props.selected.properties.width,
props.selected.properties.height

View file

@ -98,7 +98,7 @@ export function SVG(props: ISVGProps): JSX.Element {
: null}
<DimensionLayer containers={props.containers} scale={scale} root={props.children} />
<SymbolLayer scale={scale} symbols={props.symbols} />
<Selector scale={scale} selected={props.selected} /> {/* leave this at the end so it can be removed during the svg export */}
<Selector containers={props.containers} scale={scale} selected={props.selected} /> {/* leave this at the end so it can be removed during the svg export */}
</svg>
</ReactSVGPanZoom>
</div>