mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-21 16:38:23 +01:00
fix regression in nodeModel.innerRect
This commit is contained in:
parent
fc0b1929ec
commit
9ef6745d66
@ -185,6 +185,7 @@ const BlockFull = React.memo(({ nodeModel, viewModel }: FullBlockProps) => {
|
|||||||
}, [blockRef, contentRef]);
|
}, [blockRef, contentRef]);
|
||||||
|
|
||||||
const blockContentStyle = React.useMemo<React.CSSProperties>(() => {
|
const blockContentStyle = React.useMemo<React.CSSProperties>(() => {
|
||||||
|
console.log("blockContentStyle", disablePointerEvents, innerRect);
|
||||||
const retVal: React.CSSProperties = {
|
const retVal: React.CSSProperties = {
|
||||||
pointerEvents: disablePointerEvents ? "none" : undefined,
|
pointerEvents: disablePointerEvents ? "none" : undefined,
|
||||||
};
|
};
|
||||||
|
@ -288,12 +288,10 @@ export class LayoutModel {
|
|||||||
* @param contents Contains callbacks provided by the TileLayout component.
|
* @param contents Contains callbacks provided by the TileLayout component.
|
||||||
*/
|
*/
|
||||||
registerTileLayout(contents: TileLayoutContents) {
|
registerTileLayout(contents: TileLayoutContents) {
|
||||||
console.log("registerTileLayout", contents);
|
|
||||||
this.renderContent = contents.renderContent;
|
this.renderContent = contents.renderContent;
|
||||||
this.renderPreview = contents.renderPreview;
|
this.renderPreview = contents.renderPreview;
|
||||||
this.onNodeDelete = contents.onNodeDelete;
|
this.onNodeDelete = contents.onNodeDelete;
|
||||||
if (contents.gapSizePx !== undefined) {
|
if (contents.gapSizePx !== undefined) {
|
||||||
console.log("setting gapSizePx", contents.gapSizePx);
|
|
||||||
this.setter(this.gapSizePx, contents.gapSizePx);
|
this.setter(this.gapSizePx, contents.gapSizePx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -756,10 +754,11 @@ export class LayoutModel {
|
|||||||
innerRect: atom((get) => {
|
innerRect: atom((get) => {
|
||||||
const addlProps = get(addlPropsAtom);
|
const addlProps = get(addlPropsAtom);
|
||||||
const numLeafs = get(this.numLeafs);
|
const numLeafs = get(this.numLeafs);
|
||||||
|
const gapSizePx = get(this.gapSizePx);
|
||||||
if (numLeafs > 1 && addlProps?.rect) {
|
if (numLeafs > 1 && addlProps?.rect) {
|
||||||
return {
|
return {
|
||||||
width: `${addlProps.transform.width} - ${this.gapSizePx}px`,
|
width: `${addlProps.transform.width} - ${gapSizePx}px`,
|
||||||
height: `${addlProps.transform.height} - ${this.gapSizePx}px`,
|
height: `${addlProps.transform.height} - ${gapSizePx}px`,
|
||||||
} as CSSProperties;
|
} as CSSProperties;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user