Skip to content

Commit ed22358

Browse files
committed
fixes #2250
1 parent 48c502d commit ed22358

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

js/blocks/RhythmBlocks.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,23 @@ function setupRhythmBlocks() {
291291
[2, "hidden", 0, 0, [0, null]]
292292
]);
293293
}
294+
295+
flow(args, logo, turtle, blk) {
296+
let tur = logo.turtles.ithTurtle(turtle);
297+
let arg = args[0] === null ? 0 : args[0];
298+
tur.singer.skipFactor += arg;
299+
300+
let listenerName = "_skip_" + turtle;
301+
logo.setDispatchBlock(blk, turtle, listenerName);
302+
303+
let __listener = event => {
304+
tur.singer.skipFactor -= arg;
305+
};
306+
307+
logo.setTurtleListener(turtle, listenerName, __listener);
308+
309+
return [args[1], 1];
310+
}
294311
}
295312

296313
class MultiplyBeatFactorBlock extends FlowClampBlock {
@@ -432,7 +449,7 @@ function setupRhythmBlocks() {
432449
constructor() {
433450
super("rhythmicdot2");
434451
this.setPalette("rhythm");
435-
this.piemenuValuesC1 = [1, 2, 3];
452+
this.piemenuValuesC1 = [1, 2, 3];
436453
this.setHelpString([
437454
_("The Dot block extends the duration of a note by 50%.") +
438455
" " +

0 commit comments

Comments
 (0)