diff --git a/src/main/mesh.js b/src/main/mesh.js index cad977fe..e8fbbb71 100644 --- a/src/main/mesh.js +++ b/src/main/mesh.js @@ -276,8 +276,8 @@ function space_init(data) { case 'KeyF': return selection.floor().focus(); case 'KeyM': - if (shiftKey) return api.tool.mirror(); - return api.tool.merge(); + if (shiftKey) return api.tool.merge(); + return api.tool.mirror(); case 'KeyA': return api.tool.analyze(); case 'KeyR': @@ -296,8 +296,8 @@ function space_init(data) { case 'KeyL': return api.log.toggle(); case 'KeyS': - if (shiftKey) return call.edit_split(); - return selection.visible({toggle:true}); + if (shiftKey) return selection.visible({toggle:true}); + return call.edit_split(); case 'KeyB': return selection.boundsBox({toggle:true}); case 'KeyH': diff --git a/src/mesh/build.js b/src/mesh/build.js index 5f9ca0f2..3da8d577 100644 --- a/src/mesh/build.js +++ b/src/mesh/build.js @@ -351,7 +351,7 @@ function ui_build() { // return function bound to field editing clicks // builds a modal dialog that updates the object and field - function field_edit(title, set) { + function field_edit(title, set, opt = {}) { return function(ev) { let value = ev.target.innerText; let onclick = (ev) => { @@ -362,7 +362,9 @@ function ui_build() { } for (let g of api.selection.groups()) { set(g, tempval, value); - g.floor(mesh.group); + if (opt.floor !== false) { + g.floor(mesh.group); + } defer_selection(); // update ui } }; @@ -475,6 +477,24 @@ function ui_build() { group.rotation(r.x, r.y, val/rad); }); + // bind position editable fields + let { group_val_X_pos, group_val_Y_pos, group_val_Z_pos } = bound; + [ group_val_X_pos, group_val_Y_pos, group_val_Z_pos ].forEach(e => { + e.classList.add('editable'); + }); + group_val_X_pos.onclick = field_edit('x position', (group, val) => { + let r = group.position(); + group.position(val, r.y, r.z); + }, { floor: false }); + group_val_Y_pos.onclick = field_edit('y position', (group, val) => { + let r = group.position(); + group.position(r.x, val, r.z); + }, { floor: false }); + group_val_Z_pos.onclick = field_edit('z position', (group, val) => { + let r = group.position(); + group.position(r.x, r.y, val); + }, { floor: false }); + // bind scale editable fields let pedit = prefs.map.edit; let { span_val_X_size, span_val_Y_size, span_val_Z_size } = bound;