add right click to set camera focus
This commit is contained in:
parent
bfc99c0155
commit
cd81d6052f
6 changed files with 18 additions and 2 deletions
|
|
@ -470,6 +470,13 @@
|
|||
}
|
||||
}
|
||||
|
||||
function setFocus() {
|
||||
let int = contextInt[0];
|
||||
if (int && int.object && int.object.widget) {
|
||||
API.space.set_focus(undefined, int.point);
|
||||
}
|
||||
}
|
||||
|
||||
function duplicateSelection() {
|
||||
API.selection.for_widgets(function(widget) {
|
||||
let mesh = widget.mesh;
|
||||
|
|
@ -2530,6 +2537,7 @@
|
|||
$('context-duplicate').onclick = duplicateSelection;
|
||||
$('context-mirror').onclick = mirrorSelection;
|
||||
$('context-layflat').onclick = layFlat;
|
||||
$('context-setfocus').onclick = setFocus;
|
||||
|
||||
UI.modal.onclick = API.modal.hide;
|
||||
UI.modalBox.onclick = (ev) => { ev.stopPropagation() };
|
||||
|
|
|
|||
|
|
@ -389,7 +389,12 @@
|
|||
work: KIRI.work
|
||||
};
|
||||
|
||||
function setFocus(widgets) {
|
||||
function setFocus(widgets, point) {
|
||||
if (point) {
|
||||
SPACE.platform.setCenter(point.x, point.z, point.y);
|
||||
SPACE.view.setFocus(new THREE.Vector3(point.x, point.y, point.z));
|
||||
return;
|
||||
}
|
||||
if (widgets === undefined) {
|
||||
widgets = WIDGETS;
|
||||
} else if (!Array.isArray) {
|
||||
|
|
|
|||
|
|
@ -636,7 +636,7 @@
|
|||
|
||||
subst.material = UTIL.round(emitted,2);
|
||||
subst.time = UTIL.round(time,2);
|
||||
subst['print-time'] = subst.time;
|
||||
subst['print_time'] = subst.time;
|
||||
|
||||
append("; --- shutdown ---");
|
||||
appendAllSub(device.gcodePost);
|
||||
|
|
|
|||
|
|
@ -1566,6 +1566,7 @@ th, tr, td, label {
|
|||
border-top: 1px solid #ddd;
|
||||
border-bottom: 1px solid #ddd;
|
||||
background-color: #eee;
|
||||
color: black;
|
||||
}
|
||||
#context-menu .sep {
|
||||
border-top: 1px solid #ddd;
|
||||
|
|
|
|||
|
|
@ -456,6 +456,7 @@
|
|||
<button id="context-layflat" lk="rc_lafl">lay flat</button>
|
||||
<button id="context-mirror" lk="rc_mirr">mirror</button>
|
||||
<button id="context-duplicate" lk="rc_dupl">duplicate</button>
|
||||
<button id="context-setfocus" lk="rc_focs">set focus</button>
|
||||
<div class="sep"></div>
|
||||
<button id="context-export-stl" lk="rc_xstl">export as STL</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ kiri.lang['en-us'] = {
|
|||
rc_lafl: "lay flat",
|
||||
rc_mirr: "mirror",
|
||||
rc_dupl: "duplicate",
|
||||
rc_focs: "set focus",
|
||||
rc_xstl: "export as STL",
|
||||
|
||||
// DEVICE MENU and related dialogs
|
||||
|
|
|
|||
Loading…
Reference in a new issue