Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: v10.4.2 #7879

Merged
merged 4 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading