blockly > BlockDragger > getNewLocationAfterDrag_

BlockDragger.getNewLocationAfterDrag_() method

Calculates the drag delta and new location values after a block is dragged.

Signature:

protected getNewLocationAfterDrag_(currentDragDeltaXY: Coordinate): {
        delta: Coordinate;
        newLocation: Coordinate;
    };

Parameters

Parameter Type Description
currentDragDeltaXY Coordinate How far the pointer has moved from the start of the drag, in pixel units.

Returns:

{ delta: Coordinate; newLocation: Coordinate; }

New location after drag. delta is in workspace units. newLocation is the new coordinate where the block should end up.