update index view on field setting update
This commit is contained in:
parent
41141816ba
commit
a0b749ea21
1 changed files with 23 additions and 0 deletions
|
|
@ -189,6 +189,7 @@ CAM.init = function(kiri, api) {
|
|||
api.ui.camStock.marker.style.display = proc.camStockOn ? 'flex' : 'none';
|
||||
api.platform.update_bounds();
|
||||
updateAxisMode();
|
||||
updateIndex();
|
||||
updateStock();
|
||||
if (!poppedRec) {
|
||||
func.opRender();
|
||||
|
|
@ -408,6 +409,28 @@ CAM.init = function(kiri, api) {
|
|||
}
|
||||
});
|
||||
|
||||
function updateIndex() {
|
||||
let index = 0;
|
||||
let indexing = false;
|
||||
for (let op of current.process.ops) {
|
||||
if (op.type === '|') {
|
||||
break;
|
||||
}
|
||||
if (op.type === 'index') {
|
||||
indexing = true;
|
||||
if (op.absolute) {
|
||||
index = op.degrees
|
||||
} else {
|
||||
index += op.degrees;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (let widget of API.widgets.all()) {
|
||||
widget.setAxisIndex(isPreview || !isIndexed ? 0 : -index);
|
||||
}
|
||||
currentIndex = isIndexed && !isPreview ? index * DEG2RAD : 0;
|
||||
}
|
||||
|
||||
api.event.on("cam.op.render", func.opRender = () => {
|
||||
let oplist = current.process.ops;
|
||||
if (!(isCamMode && oplist)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue