Skip to content
Open
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
23 changes: 12 additions & 11 deletions js/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@
protoblock.name === "nameddo" &&
protoblock.defaults[0] === that.blockList[oldBlock].value
) {
setTimeout(() =>{
setTimeout(() => {
blockPalette.remove(protoblock, that.blockList[oldBlock].value);
delete that
.protoBlockDict["myDo_" + that.blockList[oldBlock].value];
Expand Down Expand Up @@ -1079,7 +1079,7 @@
} else if (this.blockList[parentblk].name === "temperament1") {
cblk = this.blockList[parentblk].connections[1];
if (cblk == null) {
const postProcess = (args) =>{
const postProcess = (args) => {
const parentblk = args[0];
const oldBlock = args[1];

Expand Down Expand Up @@ -1351,7 +1351,7 @@
return;
}
}

if (thisBlockobj.name === "rest2") {
this._deletePitchBlocks(thisBlock);
} else {
Expand Down Expand Up @@ -2096,8 +2096,9 @@
}
}

this.addDefaultBlock(parentblk, thisBlock, actionCheck);

if (this.blockList[parentblk].name !== "pitch") {
this.addDefaultBlock(parentblk, thisBlock, actionCheck);
}
/**
* Put block adjustments inside a slight delay to make the
* addition/substraction of vspace and changes of block shape
Expand Down Expand Up @@ -2169,7 +2170,7 @@
if (type1 === "vspacein" && type2 === "vspaceout") {
return true;
}

if (type1 === "in" && type2 === "out") {
return true;
}
Expand Down Expand Up @@ -3310,7 +3311,7 @@

postProcessArg = [thisBlock, DEFAULTCHORD];
} else if (name === "accidentalname") {
postProcess = (args) =>{
postProcess = (args) => {
const b = args[0];
const v = args[1];
that.blockList[b].value = v;
Expand Down Expand Up @@ -6450,7 +6451,7 @@
if (this.protoBlockDict[blockObjs[c][1][0]] !== undefined) {
if (
this.protoBlockDict[blockObjs[c][1][0]].dockTypes[
cc
cc

Check warning on line 6454 in js/blocks.js

View workflow job for this annotation

GitHub Actions / Lint updated JavaScript files with ESLint

Expected indentation of 56 spaces but found 52
] !== "out"
) {
flowBlock = false;
Expand Down Expand Up @@ -7052,18 +7053,18 @@
this.setSelectedBlocks = (blocks) => {
this.selectedBlocks = blocks;
};

/**
* Checks if coordinates intersect with any block
* @public
* @param {number} x - The x coordinate to check
* @param {number} y - The y coordinate to check
* @returns {boolean} True if coordinates intersect with a block
*/
this.isCoordinateOnBlock = function(x, y) {
this.isCoordinateOnBlock = function (x, y) {
return this.blockList.some(block => {
if (block.trash) return false;

const blockX = block.container.x;
const blockY = block.container.y;
return x >= blockX &&
Expand Down