Cut is back

This commit is contained in:
lunarcleint
2023-07-25 16:18:52 -07:00
parent 4867aa0839
commit e0963c5f0a
+15 -3
View File
@@ -157,6 +157,11 @@ class Charter extends UIState {
onSelect: _edit_paste
},
null,
{
label: "Cut",
keybind: [CONTROL, X],
onSelect: _edit_cut
},
{
label: "Delete",
keybind: [DELETE],
@@ -990,12 +995,19 @@ class Charter extends UIState {
}
}
selection = sObjects;
trace(sObjects);
addToUndo(CCreateSelection(sObjects.copy()));
addToUndo(CCreateSelection(sObjects));
}
function _edit_cut(_) {
if (selection == null || selection.length == 0) return;
_edit_copy(_);
deleteSelection(selection, false);
selection = [];
}
function _edit_delete(_) {
if (selection == null) return;
if (selection == null || selection.length == 0) return;
selection = deleteSelection(selection);
}