mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-24 05:48:59 +08:00
refactor(editor): add dom renderer entry for canvas element (#12149)
This commit is contained in:
@@ -2,6 +2,7 @@ import { addAttachments } from '@blocksuite/affine-block-attachment';
|
||||
import { EdgelessFrameManagerIdentifier } from '@blocksuite/affine-block-frame';
|
||||
import { addImages } from '@blocksuite/affine-block-image';
|
||||
import {
|
||||
CanvasRenderer,
|
||||
DefaultTool,
|
||||
EdgelessCRUDIdentifier,
|
||||
ExportManager,
|
||||
@@ -509,6 +510,14 @@ export class EdgelessClipboardController extends PageClipboard {
|
||||
this._checkCanContinueToCanvas(host, pathname, editorMode);
|
||||
}
|
||||
|
||||
// TODO: handle DOM renderer case for clipboard image generation
|
||||
if (!(this.surface.renderer instanceof CanvasRenderer)) {
|
||||
console.warn(
|
||||
'Skipping canvas generation for clipboard: DOM renderer active.'
|
||||
);
|
||||
return canvas; // Return the empty canvas or handle error
|
||||
}
|
||||
|
||||
const surfaceCanvas = this.surface.renderer.getCanvasByBound(
|
||||
bound,
|
||||
canvasElements
|
||||
|
||||
Reference in New Issue
Block a user