From 9ef6745d66ab0f5b0e376b9f9cadcd1ce92a45f9 Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Thu, 5 Sep 2024 18:07:55 -0700 Subject: [PATCH] fix regression in nodeModel.innerRect --- frontend/app/block/block.tsx | 1 + frontend/layout/lib/layoutModel.ts | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/app/block/block.tsx b/frontend/app/block/block.tsx index 02e8997c..8e512197 100644 --- a/frontend/app/block/block.tsx +++ b/frontend/app/block/block.tsx @@ -185,6 +185,7 @@ const BlockFull = React.memo(({ nodeModel, viewModel }: FullBlockProps) => { }, [blockRef, contentRef]); const blockContentStyle = React.useMemo(() => { + console.log("blockContentStyle", disablePointerEvents, innerRect); const retVal: React.CSSProperties = { pointerEvents: disablePointerEvents ? "none" : undefined, }; diff --git a/frontend/layout/lib/layoutModel.ts b/frontend/layout/lib/layoutModel.ts index 08a97395..640cbb77 100644 --- a/frontend/layout/lib/layoutModel.ts +++ b/frontend/layout/lib/layoutModel.ts @@ -288,12 +288,10 @@ export class LayoutModel { * @param contents Contains callbacks provided by the TileLayout component. */ registerTileLayout(contents: TileLayoutContents) { - console.log("registerTileLayout", contents); this.renderContent = contents.renderContent; this.renderPreview = contents.renderPreview; this.onNodeDelete = contents.onNodeDelete; if (contents.gapSizePx !== undefined) { - console.log("setting gapSizePx", contents.gapSizePx); this.setter(this.gapSizePx, contents.gapSizePx); } } @@ -756,10 +754,11 @@ export class LayoutModel { innerRect: atom((get) => { const addlProps = get(addlPropsAtom); const numLeafs = get(this.numLeafs); + const gapSizePx = get(this.gapSizePx); if (numLeafs > 1 && addlProps?.rect) { return { - width: `${addlProps.transform.width} - ${this.gapSizePx}px`, - height: `${addlProps.transform.height} - ${this.gapSizePx}px`, + width: `${addlProps.transform.width} - ${gapSizePx}px`, + height: `${addlProps.transform.height} - ${gapSizePx}px`, } as CSSProperties; } else { return null;