fix widget cache bug

This commit is contained in:
Stewart Allen 2021-01-29 13:25:41 -05:00
commit 27c8d157dd
3 changed files with 6 additions and 11 deletions

View file

@ -105,21 +105,16 @@ KIRI.work = {
}, },
config: function(obj) { config: function(obj) {
send("config", obj, function(reply) { send("config", obj, function(reply) { });
// console.log({config:reply});
});
}, },
clear: function(widget) { clear: function(widget) {
send("clear", widget ? {id:widget.id} : {}, function(reply) { syncd = {};
syncd = {}; send("clear", widget ? {id:widget.id} : {}, function(reply) { });
});
}, },
snap: function(data) { snap: function(data) {
send("snap", data, function(reply) { send("snap", data, function(reply) { });
// console.log({snap:reply})
});
}, },
// widget sync // widget sync

View file

@ -42,7 +42,7 @@
if (KIRI.worker) if (KIRI.worker)
KIRI.worker.cam_traces = function(data, send) { KIRI.worker.cam_traces = function(data, send) {
const { settings } = data; const { settings } = data;
const widgets = Object.values(cache); const widgets = Object.values(wcache);
const fresh = widgets.filter(widget => CAM.traces(settings, widget)); const fresh = widgets.filter(widget => CAM.traces(settings, widget));
send.done(KIRI.codec.encode(fresh.map(widget => { return { send.done(KIRI.codec.encode(fresh.map(widget => { return {
id: widget.id, id: widget.id,

View file

@ -1096,7 +1096,7 @@
let terrain = slicer.slice(tzindex, { each: (data, index, total) => { let terrain = slicer.slice(tzindex, { each: (data, index, total) => {
tshadow = POLY.union(tshadow.slice().appendAll(data.tops), 0.01, true); tshadow = POLY.union(tshadow.slice().appendAll(data.tops), 0.01, true);
tslices.push(data.slice); tslices.push(data.slice);
if (true) { if (false) {
const slice = data.slice; const slice = data.slice;
sliceAll.push(slice); sliceAll.push(slice);
slice.output() slice.output()