mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-18 14:56:59 +08:00
fix(editor): missing connectors when click copy as image action in surface-ref-toolbar (#11137)
Continue #10933
This commit is contained in:
@@ -44,7 +44,7 @@ export const BUILT_IN_GROUPS: MenuItemGroup<SurfaceRefToolbarContext>[] = [
|
||||
return;
|
||||
}
|
||||
|
||||
edgelessToBlob(ctx.host, {
|
||||
edgelessToBlob(editor, {
|
||||
surfaceRefBlock: ctx.blockComponent,
|
||||
surfaceRenderer,
|
||||
edgelessElement: referencedModel,
|
||||
@@ -84,7 +84,7 @@ export const BUILT_IN_GROUPS: MenuItemGroup<SurfaceRefToolbarContext>[] = [
|
||||
return;
|
||||
}
|
||||
|
||||
edgelessToBlob(ctx.host, {
|
||||
edgelessToBlob(editor, {
|
||||
surfaceRefBlock: ctx.blockComponent,
|
||||
surfaceRenderer,
|
||||
edgelessElement: referencedModel,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import type { CanvasRenderer } from '@blocksuite/affine-block-surface';
|
||||
import { ExportManager } from '@blocksuite/affine-block-surface';
|
||||
import type { SurfaceRefBlockComponent } from '@blocksuite/affine-block-surface-ref';
|
||||
import { isTopLevelBlock } from '@blocksuite/affine-shared/utils';
|
||||
import type { EditorHost } from '@blocksuite/block-std';
|
||||
import {
|
||||
GfxControllerIdentifier,
|
||||
@@ -21,15 +20,14 @@ export const edgelessToBlob = async (
|
||||
const { edgelessElement } = options;
|
||||
const exportManager = host.std.get(ExportManager);
|
||||
const bound = Bound.deserialize(edgelessElement.xywh);
|
||||
const isBlock = isTopLevelBlock(edgelessElement);
|
||||
const gfx = host.std.get(GfxControllerIdentifier);
|
||||
|
||||
const canvas = await exportManager.edgelessToCanvas(
|
||||
options.surfaceRenderer,
|
||||
bound,
|
||||
gfx,
|
||||
isBlock ? [edgelessElement] : undefined,
|
||||
isBlock ? undefined : [edgelessElement],
|
||||
undefined,
|
||||
undefined,
|
||||
{ zoom: options.surfaceRenderer.viewport.zoom }
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user