fix some slider issues

This commit is contained in:
Stewart Allen 2020-11-09 00:21:35 -05:00
commit d6b06e8ac4
3 changed files with 7 additions and 7 deletions

View file

@ -686,8 +686,7 @@
API.conf.save(); API.conf.save();
API.event.emit('slice.begin', getMode()); API.event.emit('slice.begin', getMode());
let firstMesh = true, let countdown = WIDGETS.length,
countdown = WIDGETS.length,
totalProgress, totalProgress,
track = {}, track = {},
mode = settings.mode, mode = settings.mode,
@ -720,11 +719,11 @@
if (lastMsg) segtimes[`${segNumber++}_${lastMsg}`] = mark - startTime; if (lastMsg) segtimes[`${segNumber++}_${lastMsg}`] = mark - startTime;
segtimes.total = UTIL.time() - now; segtimes.total = UTIL.time() - now;
API.event.emit('slice', getMode()); API.event.emit('slice', getMode());
firstMesh = false;
} }
// on done // on done
segtimes[`${segNumber}_draw`] = widget.render(stack); segtimes[`${segNumber}_draw`] = widget.render(stack);
updateSliderMax(true); updateSliderMax(true);
setVisibleLayer(-1, 0);
// clear wireframe // clear wireframe
widget.setWireframe(false, color.wireframe, color.wireframe_opacity); widget.setWireframe(false, color.wireframe, color.wireframe_opacity);
widget.setOpacity(camOrLaser ? color.cam_sliced_opacity : color.sliced_opacity); widget.setOpacity(camOrLaser ? color.cam_sliced_opacity : color.sliced_opacity);
@ -828,7 +827,7 @@
if (feature.preview) { if (feature.preview) {
SPACE.update(); SPACE.update();
updateSliderMax(true); updateSliderMax(true);
showSlices(); setVisibleLayer(-1, 0);
} }
if (typeof(callback) === 'function') { if (typeof(callback) === 'function') {
@ -1929,7 +1928,7 @@
KIRI.work.clear(); KIRI.work.clear();
STACKS.clear(); STACKS.clear();
hideSlider(); hideSlider();
setVisibleLayer(0,0); setVisibleLayer();
setWidgetVisibility(true); setWidgetVisibility(true);
setOpacity(1); setOpacity(1);
break; break;

View file

@ -35,7 +35,7 @@
print.render = KIRI.driver.FDM.prepareRender(print.output, progress => { print.render = KIRI.driver.FDM.prepareRender(print.output, progress => {
update(0.5 + progress * 0.5); update(0.5 + progress * 0.5);
}, { thin: true, print: 0, move: 0x003366 }); }, { thin: true, print: 0, move: 0x003366, speed: false });
return print.render; return print.render;
}; };

View file

@ -385,6 +385,7 @@
const opts = options || {}; const opts = options || {};
const tools = opts.tools || {}; const tools = opts.tools || {};
const thin = opts.thin || false; const thin = opts.thin || false;
const ckspeed = opts.speed !== false;
const moveColor = opts.move >= 0 ? opts.move : 0xaaaaaa; const moveColor = opts.move >= 0 ? opts.move : 0xaaaaaa;
const printColor = opts.print >= 0 ? opts.print : 0x777700; const printColor = opts.print >= 0 ? opts.print : 0x777700;
const layers = []; const layers = [];
@ -420,7 +421,7 @@
} }
if (lastOut) { if (lastOut) {
if (out.emit) { if (out.emit) {
if (!lastOut.emit || out.speed !== lastOut.speed) { if (!lastOut.emit || (ckspeed && out.speed !== lastOut.speed)) {
current = newPolygon().setOpen(); current = newPolygon().setOpen();
current.push(lastOut.point); current.push(lastOut.point);
current.color = hsv2rgb({h:out.speed/maxspd, s:1, v:1}, true); current.color = hsv2rgb({h:out.speed/maxspd, s:1, v:1}, true);