fix restoring widget indexing, tab clear on mode change
This commit is contained in:
parent
283f2d081a
commit
11def36a98
2 changed files with 11 additions and 9 deletions
|
|
@ -88,7 +88,7 @@ CAM.init = function(kiri, api) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (let widget of api.widgets.all()) {
|
for (let widget of api.widgets.all()) {
|
||||||
widget.setIndexed(camStock && isIndexed ? camStock.scale.z : 0);
|
widget.setIndexed(camStock && isIndexed ? true : false);
|
||||||
}
|
}
|
||||||
api.platform.update_bounds();
|
api.platform.update_bounds();
|
||||||
// add or remove clock op depending on indexing
|
// add or remove clock op depending on indexing
|
||||||
|
|
@ -110,7 +110,7 @@ CAM.init = function(kiri, api) {
|
||||||
api.event.on("widget.add", widget => {
|
api.event.on("widget.add", widget => {
|
||||||
if (isCamMode && !Array.isArray(widget)) {
|
if (isCamMode && !Array.isArray(widget)) {
|
||||||
updateAxisMode(true);
|
updateAxisMode(true);
|
||||||
widget.setIndexed(camStock && isIndexed ? camStock.scale.z : 0);
|
widget.setIndexed(camStock && isIndexed ? true : false);
|
||||||
api.platform.update_bounds();
|
api.platform.update_bounds();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -140,17 +140,18 @@ CAM.init = function(kiri, api) {
|
||||||
api.event.on("mode.set", (mode) => {
|
api.event.on("mode.set", (mode) => {
|
||||||
isIndexed = undefined;
|
isIndexed = undefined;
|
||||||
isCamMode = mode === 'CAM';
|
isCamMode = mode === 'CAM';
|
||||||
$('set-tools').style.display = isCamMode ? '' : 'none';
|
|
||||||
SPACE.platform.setColor(isCamMode ? 0xeeeeee : 0xcccccc);
|
SPACE.platform.setColor(isCamMode ? 0xeeeeee : 0xcccccc);
|
||||||
updateStock();
|
$('set-tools').style.display = isCamMode ? '' : 'none';
|
||||||
|
$('camops').style.display = isCamMode && isArrange ? 'flex' : '';
|
||||||
UI.func.animate.style.display = isCamMode ? '' : 'none';
|
UI.func.animate.style.display = isCamMode ? '' : 'none';
|
||||||
if (!isCamMode) {
|
if (!isCamMode) {
|
||||||
func.clearPops();
|
func.clearPops();
|
||||||
|
func.tabClear();
|
||||||
}
|
}
|
||||||
$('camops').style.display = isCamMode && isArrange ? 'flex' : '';
|
|
||||||
// do not persist traces across page reloads
|
// do not persist traces across page reloads
|
||||||
func.traceClear();
|
func.traceClear();
|
||||||
func.opRender();
|
func.opRender();
|
||||||
|
updateStock();
|
||||||
});
|
});
|
||||||
|
|
||||||
api.event.on("view.set", (mode) => {
|
api.event.on("view.set", (mode) => {
|
||||||
|
|
@ -188,9 +189,9 @@ CAM.init = function(kiri, api) {
|
||||||
api.ui.camTabs.marker.style.display = hasTabs ? 'flex' : 'none';
|
api.ui.camTabs.marker.style.display = hasTabs ? 'flex' : 'none';
|
||||||
api.ui.camStock.marker.style.display = proc.camStockOn ? 'flex' : 'none';
|
api.ui.camStock.marker.style.display = proc.camStockOn ? 'flex' : 'none';
|
||||||
api.platform.update_bounds();
|
api.platform.update_bounds();
|
||||||
updateAxisMode();
|
|
||||||
updateIndex();
|
updateIndex();
|
||||||
updateStock();
|
updateStock();
|
||||||
|
updateAxisMode();
|
||||||
if (!poppedRec) {
|
if (!poppedRec) {
|
||||||
func.opRender();
|
func.opRender();
|
||||||
}
|
}
|
||||||
|
|
@ -822,7 +823,8 @@ CAM.init = function(kiri, api) {
|
||||||
let pos = {
|
let pos = {
|
||||||
x: showTab.pos.x - ip.x,
|
x: showTab.pos.x - ip.x,
|
||||||
y: -showTab.pos.z - ip.y,
|
y: -showTab.pos.z - ip.y,
|
||||||
z: showTab.pos.y + ip.z,
|
// z: showTab.pos.y + ip.z,
|
||||||
|
z: showTab.pos.y + ip.z + (isIndexed ? 0 : iw.track.tzoff),
|
||||||
}
|
}
|
||||||
let id = Date.now();
|
let id = Date.now();
|
||||||
let { dim, rot } = showTab;
|
let { dim, rot } = showTab;
|
||||||
|
|
|
||||||
|
|
@ -96,10 +96,10 @@ kiri.load(api => {
|
||||||
const widgets = Object.values(kiri.worker.cache);
|
const widgets = Object.values(kiri.worker.cache);
|
||||||
for (let widget of widgets) {
|
for (let widget of widgets) {
|
||||||
if (index) {
|
if (index) {
|
||||||
widget.setIndexed(1);
|
widget.setIndexed(true);
|
||||||
widget.setAxisIndex(-index);
|
widget.setAxisIndex(-index);
|
||||||
} else {
|
} else {
|
||||||
widget.setIndexed(0);
|
widget.setIndexed(false);
|
||||||
widget.setAxisIndex(0);
|
widget.setAxisIndex(0);
|
||||||
}
|
}
|
||||||
CAM.surface_prep(widget, index);
|
CAM.surface_prep(widget, index);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue