* When a layout is modified and only one leaf is remaining, we need to make sure it is no longer magnified. * @param leafOrder The new leaf order array to use when validating the number of leafs remaining. * @param addlProps The new additional properties object for all leafs in the layout.
(leafOrder: LeafOrderEntry[], addlProps: Record<string, LayoutNodeAdditionalProps>)
| 934 | * @param addlProps The new additional properties object for all leafs in the layout. |
| 935 | */ |
| 936 | private validateMagnifiedNode(leafOrder: LeafOrderEntry[], addlProps: Record<string, LayoutNodeAdditionalProps>) { |
| 937 | if (leafOrder.length == 1) { |
| 938 | const lastLeafId = leafOrder[0].nodeid; |
| 939 | this.treeState.magnifiedNodeId = undefined; |
| 940 | this.magnifiedNodeId = undefined; |
| 941 | |
| 942 | // Unset the transform for the sole leaf. |
| 943 | if (lastLeafId in addlProps) addlProps[lastLeafId].transform = undefined; |
| 944 | } |
| 945 | } |
| 946 | |
| 947 | /** |
| 948 | * Helper function for the placeholderTransform atom, which computes the new transform value when the pending action changes. |