Skip to content

Commit

Permalink
Fix Ctrl+D error
Browse files Browse the repository at this point in the history
  • Loading branch information
ricktu288 committed Oct 14, 2024
1 parent 3c98145 commit 633eecc
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/simulator/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,14 +374,16 @@ async function startApp() {
}
//Ctrl+D
if (e.ctrlKey && e.keyCode == 68) {
if (scene.objs[editor.selectedObjIndex].constructor.type == 'Handle') {
scene.cloneObjsByHandle(editor.selectedObjIndex);
} else {
scene.cloneObj(editor.selectedObjIndex);
}
if (editor.selectedObjIndex != -1) {
if (scene.objs[editor.selectedObjIndex].constructor.type == 'Handle') {
scene.cloneObjsByHandle(editor.selectedObjIndex);
} else {
scene.cloneObj(editor.selectedObjIndex);
}

simulator.updateSimulation(!scene.objs[editor.selectedObjIndex].constructor.isOptical, true);
editor.onActionComplete();
simulator.updateSimulation(!scene.objs[editor.selectedObjIndex].constructor.isOptical, true);
editor.onActionComplete();
}
return false;
}
//Ctrl+Y
Expand Down

0 comments on commit 633eecc

Please sign in to comment.