From d73bcb82ea421f929a3500c7cb2835b577d37f2a Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Fri, 16 Aug 2024 12:21:44 -0700 Subject: [PATCH] fix last-magnified node logic --- frontend/layout/lib/layoutModel.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/layout/lib/layoutModel.ts b/frontend/layout/lib/layoutModel.ts index bf4f18520..2efc300ff 100644 --- a/frontend/layout/lib/layoutModel.ts +++ b/frontend/layout/lib/layoutModel.ts @@ -400,6 +400,7 @@ export class LayoutModel { ); additionalPropsMap[node.id].transform = transform; } + additionalPropsMap[node.id].isLastMagnifiedNode = this.lastMagnifiedNodeId === node.id; return; } @@ -464,7 +465,6 @@ export class LayoutModel { ...additionalProps, pixelToSizeRatio, resizeHandles, - isLastMagnifiedNode: this.lastMagnifiedNodeId === node.id, }; } @@ -572,7 +572,10 @@ export class LayoutModel { }; // If the node is already magnified, then it is being un-magnified and should be set as the last-magnified node to ensure it has a higher z-index as it transitions back to its original position. - if (this.treeState.magnifiedNodeId === node.id) this.lastMagnifiedNodeId = node.id; + if (this.treeState.magnifiedNodeId === node.id) { + console.log("new last-magnified-node", node.id); + this.lastMagnifiedNodeId = node.id; + } this.treeReducer(action); }