fix addl props nullref

This commit is contained in:
Evan Simkowitz 2024-08-16 17:59:53 -07:00
parent ae7d85630b
commit 7a1a3a2bea
No known key found for this signature in database
GPG Key ID: 5041D45BF5DCE80B

View File

@ -387,20 +387,23 @@ export class LayoutModel {
if (!node.children?.length) { if (!node.children?.length) {
// console.log("adding node to leafs", node); // console.log("adding node to leafs", node);
leafs.push(node); leafs.push(node);
if (this.treeState.magnifiedNodeId === node.id) { const addlProps = additionalPropsMap[node.id];
const boundingRect = getBoundingRect(); if (addlProps) {
const transform = setTransform( if (this.treeState.magnifiedNodeId === node.id) {
{ const boundingRect = getBoundingRect();
top: boundingRect.height * 0.05, const transform = setTransform(
left: boundingRect.width * 0.05, {
width: boundingRect.width * 0.9, top: boundingRect.height * 0.05,
height: boundingRect.height * 0.9, left: boundingRect.width * 0.05,
}, width: boundingRect.width * 0.9,
true height: boundingRect.height * 0.9,
); },
additionalPropsMap[node.id].transform = transform; true
);
addlProps.transform = transform;
}
addlProps.isLastMagnifiedNode = this.lastMagnifiedNodeId === node.id;
} }
additionalPropsMap[node.id].isLastMagnifiedNode = this.lastMagnifiedNodeId === node.id;
return; return;
} }