fix rotate/resize
This commit is contained in:
parent
ce423fddcc
commit
c49454ed6a
3 changed files with 52 additions and 13 deletions
|
|
@ -80,7 +80,7 @@ const MENUBAR_HTML = `
|
|||
</div>
|
||||
</span>
|
||||
<span>
|
||||
<label lk="re_menu">sender</label>
|
||||
<label lk="re_menu">render</label>
|
||||
<div class="top-menu-drop top-menu-left">
|
||||
<div class="content">
|
||||
<div id="render-solid">
|
||||
|
|
@ -137,10 +137,10 @@ const MENUBAR_HTML = `
|
|||
<div class="menubar-separator"></div>
|
||||
<div class="f-row top-menu">
|
||||
<span id="tool-nozzle"><i class="fas fa-location-pin" title="extruder"></i>
|
||||
<div id="ft-nozzle" class="f-col pop hide"></div>
|
||||
<div id="ft-nozzle" class="f-col pop"></div>
|
||||
</span>
|
||||
<span id="tool-rotate"><i class="fas fa-rotate-right" title="rotate selection"></i>
|
||||
<div id="ft-rotate" class="grid pop hide">
|
||||
<div id="ft-rotate" class="grid pop">
|
||||
<div id="rot_x_lt"><i class="fas fa-chevron-left"></i></div>
|
||||
<label>X</label>
|
||||
<div id="rot_x_gt"><i class="fas fa-chevron-right"></i></div>
|
||||
|
|
@ -159,7 +159,7 @@ const MENUBAR_HTML = `
|
|||
</div>
|
||||
</span>
|
||||
<span id="tool-scale"><i class="fas fa-expand" title="scale or resize selection"></i>
|
||||
<div id="ft-scale" class="grid pop hide">
|
||||
<div id="ft-scale" class="grid pop">
|
||||
<div><label>X</label><input id="lock_x" type="checkbox" checked></div>
|
||||
<div><label>Y</label><input id="lock_y" type="checkbox" checked></div>
|
||||
<div><label>Z</label><input id="lock_z" type="checkbox" checked></div>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import { THREE } from '../../ext/three.js';
|
|||
import { tool as MeshTool } from '../../mesh/tool.js';
|
||||
import { encode as objEncode } from '../../load/obj.js';
|
||||
import { encode as stlEncode } from '../../load/stl.js';
|
||||
import { $ } from '../../moto/webui.js';
|
||||
|
||||
/**
|
||||
* Array of currently selected widget meshes.
|
||||
|
|
@ -546,12 +547,12 @@ function parse_as_float(e) {
|
|||
function input_binding(ui) {
|
||||
// on enter but not on blur
|
||||
space.event.onEnterKey([
|
||||
// ui.scale.X, (e) => input_scale(e, ui),
|
||||
// ui.scale.Y, (e) => input_scale(e, ui),
|
||||
// ui.scale.Z, (e) => input_scale(e, ui),
|
||||
// ui.size.X, (e) => input_resize(e, ui),
|
||||
// ui.size.Y, (e) => input_resize(e, ui),
|
||||
// ui.size.Z, (e) => input_resize(e, ui),
|
||||
ui.scale.X, (e) => input_scale(e, ui),
|
||||
ui.scale.Y, (e) => input_scale(e, ui),
|
||||
ui.scale.Z, (e) => input_scale(e, ui),
|
||||
ui.size.X, (e) => input_resize(e, ui),
|
||||
ui.size.Y, (e) => input_resize(e, ui),
|
||||
ui.size.Z, (e) => input_resize(e, ui),
|
||||
]);
|
||||
// on enter and blur
|
||||
space.event.onEnterKey([
|
||||
|
|
@ -563,9 +564,9 @@ function input_binding(ui) {
|
|||
ui.toolShaftLen, updateTool,
|
||||
ui.toolTaperTip, updateTool,
|
||||
ui.toolTaperAngle, updateTool,
|
||||
// $('rot_x'), parse_as_float,
|
||||
// $('rot_y'), parse_as_float,
|
||||
// $('rot_z'), parse_as_float
|
||||
$('rot_x'), parse_as_float,
|
||||
$('rot_y'), parse_as_float,
|
||||
$('rot_z'), parse_as_float
|
||||
], true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,44 @@
|
|||
display: flex;
|
||||
}
|
||||
|
||||
#menubar .top-menu > span > .pop {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
z-index: 90;
|
||||
margin-top: 3px;
|
||||
border: 1px solid var(--border-gray);
|
||||
border-radius: 6px;
|
||||
background: var(--menubar-back);
|
||||
color: var(--menubar-fore);
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
#menubar .top-menu > span > .pop::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: -6px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 6px;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
#menubar .top-menu > span:hover > .pop {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#menubar #ft-rotate.pop,
|
||||
#menubar #ft-scale.pop {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#menubar #tool-rotate:hover #ft-rotate.pop,
|
||||
#menubar #tool-scale:hover #ft-scale.pop {
|
||||
display: grid;
|
||||
}
|
||||
|
||||
#menubar .top-menu label,
|
||||
#menubar .top-menu svg {
|
||||
color: inherit;
|
||||
|
|
|
|||
Loading…
Reference in a new issue