mirror of
https://github.com/google/blockly.git
synced 2026-01-09 01:50:11 +01:00
fix: extra insertion markers being created (#8120)
* fix: extra insertion markers being created * chore: remove unused value
This commit is contained in:
@@ -15,15 +15,6 @@ import * as registry from './registry.js';
|
||||
import {Renderer as ZelosRenderer} from './renderers/zelos/renderer.js';
|
||||
import {ConnectionType} from './connection_type.js';
|
||||
|
||||
/**
|
||||
* An error message to throw if the block created by createMarkerBlock_ is
|
||||
* missing any components.
|
||||
*/
|
||||
const DUPLICATE_BLOCK_ERROR =
|
||||
'The insertion marker previewer tried to create a marker but the result ' +
|
||||
'is missing a connection. If you are using a mutator, make sure your ' +
|
||||
'domToMutation method is properly defined.';
|
||||
|
||||
export class InsertionMarkerPreviewer implements IConnectionPreviewer {
|
||||
private readonly workspace: WorkspaceSvg;
|
||||
|
||||
@@ -88,16 +79,6 @@ export class InsertionMarkerPreviewer implements IConnectionPreviewer {
|
||||
eventUtils.disable();
|
||||
try {
|
||||
this.hidePreview();
|
||||
const dragged = draggedConn.getSourceBlock();
|
||||
const marker = this.createInsertionMarker(dragged);
|
||||
const markerConn = this.getMatchingConnection(
|
||||
dragged,
|
||||
marker,
|
||||
draggedConn,
|
||||
);
|
||||
if (!markerConn) {
|
||||
throw Error(DUPLICATE_BLOCK_ERROR);
|
||||
}
|
||||
|
||||
// TODO(7898): Instead of special casing, we should change the dragger to
|
||||
// track the change in distance between the dragged connection and the
|
||||
|
||||
Reference in New Issue
Block a user