Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/g6/src/elements/nodes/base-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,15 +460,15 @@ function getBoundsInOffscreen(context: RuntimeContext, shape: DisplayObject) {
if (!context) return shape.getLocalBounds();

// 将主图形靠背至全局空间,避免受到父级 transform 的影响
// 合理的操作应该是靠背至离屏画布,但目前 G 有点问题
// 合理的操作应该是拷贝至离屏画布,但目前 G 有点问题
// Move the main graphic to the global space to avoid being affected by the parent transform
// The reasonable operation should be moved to the off-screen canvas, but there is a problem with G at present
const canvas = context.canvas.getLayer();
const substitute = shape.cloneNode();
setVisibility(substitute, 'hidden');
canvas.appendChild(substitute);
const bounds = substitute.getLocalBounds();
canvas.removeChild(substitute);
substitute.destroy();

return bounds;
}
Loading