disable render in some cases

This commit is contained in:
Stewart Allen 2020-11-11 08:13:40 -05:00
commit b576588529
2 changed files with 12 additions and 5 deletions

View file

@ -1231,9 +1231,11 @@
speedbar: $('speedbar'), speedbar: $('speedbar'),
container: container, container: container,
back: $('lt-back'),
rotate: $('lt-rotate'), rotate: $('lt-rotate'),
scale: $('lt-scale'), scale: $('lt-scale'),
nozzle: $('lt-nozzle'), nozzle: $('lt-nozzle'),
render: $('lt-render'),
modal: $('modal'), modal: $('modal'),
modalBox: $('modal-box'), modalBox: $('modal-box'),
@ -2044,7 +2046,7 @@
$('acct-export').onclick = (ev) => { ev.stopPropagation(); profileExport() }; $('acct-export').onclick = (ev) => { ev.stopPropagation(); profileExport() };
$('file-recent').onclick = () => { API.modal.show('files') }; $('file-recent').onclick = () => { API.modal.show('files') };
$('file-import').onclick = () => { API.event.import() }; $('file-import').onclick = () => { API.event.import() };
$('lt-back').onclick = API.platform.layout; UI.back.onclick = API.platform.layout;
UI.act.slice.onclick = (ev) => { ev.stopPropagation(); API.function.slice() }; UI.act.slice.onclick = (ev) => { ev.stopPropagation(); API.function.slice() };
UI.act.preview.onclick = (ev) => { ev.stopPropagation(); API.function.print() }; UI.act.preview.onclick = (ev) => { ev.stopPropagation(); API.function.print() };
UI.act.export.onclick = (ev) => { ev.stopPropagation(); API.function.export() }; UI.act.export.onclick = (ev) => { ev.stopPropagation(); API.function.export() };

View file

@ -1946,13 +1946,16 @@
} }
function setViewMode(mode) { function setViewMode(mode) {
let oldMode = viewMode; const oldMode = viewMode;
const isCAM = settings.mode === 'CAM';
viewMode = mode; viewMode = mode;
platform.deselect(); platform.deselect();
updateSelectedInfo(); updateSelectedInfo();
switch (mode) { switch (mode) {
case VIEWS.ARRANGE: case VIEWS.ARRANGE:
$('lt-back').style.display = ''; UI.back.style.display = '';
UI.render.style.display = '';
UI.render.classList.add('lt-enabled');
KIRI.work.clear(); KIRI.work.clear();
STACKS.clear(); STACKS.clear();
hideSlider(); hideSlider();
@ -1962,13 +1965,15 @@
setOpacity(1); setOpacity(1);
break; break;
case VIEWS.SLICE: case VIEWS.SLICE:
$('lt-back').style.display = 'flex'; UI.back.style.display = 'flex';
if (!isCAM) UI.render.classList.remove('lt-enabled');
updateSpeeds(); updateSpeeds();
updateSliderMax(); updateSliderMax();
setWidgetVisibility(true); setWidgetVisibility(true);
break; break;
case VIEWS.PREVIEW: case VIEWS.PREVIEW:
$('lt-back').style.display = 'flex'; UI.back.style.display = 'flex';
if (!isCAM) UI.render.classList.remove('lt-enabled');
setWidgetVisibility(true); setWidgetVisibility(true);
break; break;
default: default: