Skip to content

Commit bdc416f

Browse files
authored
release: v10.4.2
release: v10.4.2
2 parents d782d7d + a02b3c2 commit bdc416f

File tree

3 files changed

+93
-72
lines changed

3 files changed

+93
-72
lines changed

core/block_dragger.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,11 @@ export class BlockDragger implements IBlockDragger {
204204
this.updateConnectionPreview(block, delta);
205205
}
206206

207+
/**
208+
* @param draggingBlock The block being dragged.
209+
* @param dragDelta How far the pointer has moved from the position
210+
* at the start of the drag, in pixel units.
211+
*/
207212
private moveBlock(draggingBlock: BlockSvg, dragDelta: Coordinate) {
208213
const delta = this.pixelsToWorkspaceUnits_(dragDelta);
209214
const newLoc = Coordinate.sum(this.startXY_, delta);
@@ -223,6 +228,11 @@ export class BlockDragger implements IBlockDragger {
223228
/**
224229
* Returns true if we would delete the block if it was dropped at this time,
225230
* false otherwise.
231+
*
232+
* @param e The most recent move event.
233+
* @param draggingBlock The block being dragged.
234+
* @param delta How far the pointer has moved from the position
235+
* at the start of the drag, in pixel units.
226236
*/
227237
private wouldDeleteBlock(
228238
e: PointerEvent,
@@ -245,7 +255,16 @@ export class BlockDragger implements IBlockDragger {
245255
);
246256
}
247257

248-
private updateConnectionPreview(draggingBlock: BlockSvg, delta: Coordinate) {
258+
/**
259+
* @param draggingBlock The block being dragged.
260+
* @param dragDelta How far the pointer has moved from the position
261+
* at the start of the drag, in pixel units.
262+
*/
263+
private updateConnectionPreview(
264+
draggingBlock: BlockSvg,
265+
dragDelta: Coordinate,
266+
) {
267+
const delta = this.pixelsToWorkspaceUnits_(dragDelta);
249268
const currCandidate = this.connectionCandidate;
250269
const newCandidate = this.getConnectionCandidate(draggingBlock, delta);
251270
if (!newCandidate) {
@@ -333,7 +352,9 @@ export class BlockDragger implements IBlockDragger {
333352
delta: Coordinate,
334353
): ConnectionCandidate | null {
335354
const localConns = this.getLocalConnections(draggingBlock);
336-
let radius = config.snapRadius;
355+
let radius = this.connectionCandidate
356+
? config.connectingSnapRadius
357+
: config.snapRadius;
337358
let candidate = null;
338359

339360
for (const conn of localConns) {

package-lock.json

Lines changed: 68 additions & 68 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "blockly",
3-
"version": "10.4.1",
3+
"version": "10.4.2",
44
"description": "Blockly is a library for building visual programming editors.",
55
"keywords": [
66
"blockly"
@@ -101,7 +101,7 @@
101101
"readline-sync": "^1.4.10",
102102
"rimraf": "^5.0.0",
103103
"typescript": "^5.0.2",
104-
"webdriverio": "^8.16.7",
104+
"webdriverio": "^8.32.2",
105105
"yargs": "^17.2.1"
106106
},
107107
"dependencies": {

0 commit comments

Comments
 (0)