Skip to content

Commit

Permalink
fix: deprecate paste
Browse files Browse the repository at this point in the history
  • Loading branch information
BeksOmega committed Aug 3, 2023
1 parent 6e22880 commit 7b8a0ea
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions core/workspace_svg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1301,6 +1301,12 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
paste(
state: AnyDuringMigration | Element | DocumentFragment,
): ICopyable<ICopyData> | null {
deprecation.warn(
'Blockly.WorkspaceSvg.prototype.paste',
'v11',
'v12',
'Blockly.clipboard.paste',
);
if (!this.rendered || (!state['type'] && !state['tagName'])) {
return null;
}
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 7b8a0ea

Please sign in to comment.