From 7b8a0eab107c7712f8a2cca183b3e4d6d379b009 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Wed, 2 Aug 2023 22:41:29 +0000 Subject: [PATCH] fix: deprecate paste --- core/workspace_svg.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/core/workspace_svg.ts b/core/workspace_svg.ts index 5978c3197db..18f1f5fa66e 100644 --- a/core/workspace_svg.ts +++ b/core/workspace_svg.ts @@ -1301,6 +1301,12 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { paste( state: AnyDuringMigration | Element | DocumentFragment, ): ICopyable | null { + deprecation.warn( + 'Blockly.WorkspaceSvg.prototype.paste', + 'v11', + 'v12', + 'Blockly.clipboard.paste', + ); if (!this.rendered || (!state['type'] && !state['tagName'])) { return null; } @@ -1388,10 +1394,6 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { for (let i = 0, connection; (connection = connections[i]); i++) { const neighbour = connection.closest( config.snapRadius, - // TODO: This code doesn't work because it's passing an absolute - // coordinate instead of a relative coordinate. Need to - // figure out if I'm deprecating this function or if I - // need to fix this. new Coordinate(blockX, blockY), ); if (neighbour.connection) { @@ -1445,9 +1447,6 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg { // with any blocks. commentX += 50; commentY += 50; - // TODO: This code doesn't work because it's using absolute coords - // where relative coords are expected. Need to figure out what I'm - // doing with this function and if I need to fix it. comment.moveBy(commentX, commentY); } } finally {