add shift + click to duplicate an CAM op

This commit is contained in:
Stewart Allen 2023-03-16 12:08:19 -04:00
commit e9da615dc7

View file

@ -571,6 +571,7 @@ CAM.init = function(kiri, api) {
if (!clist.contains("draggable")) { if (!clist.contains("draggable")) {
return; return;
} }
// toggle enable / disable
if (!clock && (ev.ctrlKey || ev.metaKey)) { if (!clock && (ev.ctrlKey || ev.metaKey)) {
ev.preventDefault(); ev.preventDefault();
ev.stopPropagation(); ev.stopPropagation();
@ -589,6 +590,16 @@ CAM.init = function(kiri, api) {
} }
return true; return true;
} }
// duplicate op
if (!clock && ev.shiftKey) {
ev.preventDefault();
ev.stopPropagation();
oplist = current.process.ops;
oplist.push(Object.clone(rec));
API.conf.save();
func.opRender();
return true;
}
clist.add("drag"); clist.add("drag");
ev.stopPropagation(); ev.stopPropagation();
ev.preventDefault(); ev.preventDefault();