Skip to content

Commit

Permalink
Fix Undo after Clone
Browse files Browse the repository at this point in the history
  • Loading branch information
MonsterDruide1 committed Mar 18, 2023
1 parent 4e2e472 commit 0de3864
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.jadefalke2.components;

import io.github.jadefalke2.InputLine;
import io.github.jadefalke2.Script;
import io.github.jadefalke2.actions.Action;
import io.github.jadefalke2.actions.InsertEmptyLineAction;
Expand Down Expand Up @@ -53,7 +54,8 @@ public void openPopUpMenu(int[] rows, Point point, Component invoker){

setListener(deleteOption, rows, LineAction.Type.DELETE);
setListener(insertOption, new InsertEmptyLineAction(script, rows[rows.length-1]+1, rows.length));
setListener(cloneOption, rows, LineAction.Type.CLONE);
// insert dummy InputLines - unused, but the size is required for undo
setListener(cloneOption, new LineAction(script, rows, new InputLine[rows.length], LineAction.Type.CLONE));

setListener(cutOption, () -> scriptTab.getPianoRoll().cut());
setListener(copyOption, () -> scriptTab.getPianoRoll().copy());
Expand Down

0 comments on commit 0de3864

Please sign in to comment.