[go: nahoru, domu]

Skip to content

Commit

Permalink
release: v10.4.2
Browse files Browse the repository at this point in the history
release: v10.4.2
  • Loading branch information
maribethb committed Feb 21, 2024
2 parents d782d7d + a02b3c2 commit bdc416f
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 72 deletions.
25 changes: 23 additions & 2 deletions core/block_dragger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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,
Expand All @@ -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) {
Expand Down Expand Up @@ -333,7 +352,9 @@ export class BlockDragger implements IBlockDragger {
delta: Coordinate,
): ConnectionCandidate | null {
const localConns = this.getLocalConnections(draggingBlock);
let radius = config.snapRadius;
let radius = this.connectionCandidate
? config.connectingSnapRadius
: config.snapRadius;
let candidate = null;

for (const conn of localConns) {
Expand Down
136 changes: 68 additions & 68 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blockly",
"version": "10.4.1",
"version": "10.4.2",
"description": "Blockly is a library for building visual programming editors.",
"keywords": [
"blockly"
Expand Down Expand Up @@ -101,7 +101,7 @@
"readline-sync": "^1.4.10",
"rimraf": "^5.0.0",
"typescript": "^5.0.2",
"webdriverio": "^8.16.7",
"webdriverio": "^8.32.2",
"yargs": "^17.2.1"
},
"dependencies": {
Expand Down

0 comments on commit bdc416f

Please sign in to comment.