mirror of
https://github.com/google/blockly.git
synced 2026-01-07 00:50:27 +01:00
fix: insertion marker drag scaling (#7874)
* fix: insertion marker drag scaling * chore: added docs for other params
This commit is contained in:
@@ -204,6 +204,11 @@ export class BlockDragger implements IBlockDragger {
|
||||
this.updateConnectionPreview(block, delta);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param draggingBlock The block being dragged.
|
||||
* @param dragDelta How far the pointer has moved from the position
|
||||
* at the start of the drag, in pixel units.
|
||||
*/
|
||||
private moveBlock(draggingBlock: BlockSvg, dragDelta: Coordinate) {
|
||||
const delta = this.pixelsToWorkspaceUnits_(dragDelta);
|
||||
const newLoc = Coordinate.sum(this.startXY_, delta);
|
||||
@@ -223,6 +228,11 @@ export class BlockDragger implements IBlockDragger {
|
||||
/**
|
||||
* Returns true if we would delete the block if it was dropped at this time,
|
||||
* false otherwise.
|
||||
*
|
||||
* @param e The most recent move event.
|
||||
* @param draggingBlock The block being dragged.
|
||||
* @param delta How far the pointer has moved from the position
|
||||
* at the start of the drag, in pixel units.
|
||||
*/
|
||||
private wouldDeleteBlock(
|
||||
e: PointerEvent,
|
||||
@@ -245,7 +255,16 @@ export class BlockDragger implements IBlockDragger {
|
||||
);
|
||||
}
|
||||
|
||||
private updateConnectionPreview(draggingBlock: BlockSvg, delta: Coordinate) {
|
||||
/**
|
||||
* @param draggingBlock The block being dragged.
|
||||
* @param dragDelta How far the pointer has moved from the position
|
||||
* at the start of the drag, in pixel units.
|
||||
*/
|
||||
private updateConnectionPreview(
|
||||
draggingBlock: BlockSvg,
|
||||
dragDelta: Coordinate,
|
||||
) {
|
||||
const delta = this.pixelsToWorkspaceUnits_(dragDelta);
|
||||
const currCandidate = this.connectionCandidate;
|
||||
const newCandidate = this.getConnectionCandidate(draggingBlock, delta);
|
||||
if (!newCandidate) {
|
||||
|
||||
Reference in New Issue
Block a user