update stock index visuals on widget.add event

This commit is contained in:
Stewart Allen 2022-10-31 09:59:50 -04:00
commit e1d83b01c6
2 changed files with 6 additions and 1 deletions

View file

@ -90,6 +90,12 @@ CAM.init = function(kiri, api) {
} }
} }
api.event.on("widget.add", widget => {
if (isCamMode) {
setAnimationStyle(api.conf.get());
}
});
// wire up animate button in ui // wire up animate button in ui
api.event.on("function.animate", (mode) => { api.event.on("function.animate", (mode) => {
if (isAnimate) { if (isAnimate) {

View file

@ -89,7 +89,6 @@ function platformUpdateTopZ(zdelta) {
const { process, stock } = current(); const { process, stock } = current();
const hasStock = stock.x && stock.y && stock.z; const hasStock = stock.x && stock.y && stock.z;
const MODE = get_mode(); const MODE = get_mode();
api.widgets.each(widget => { api.widgets.each(widget => {
if (MODE === MODES.CAM) { if (MODE === MODES.CAM) {
const bounds = widget.getBoundingBox(); const bounds = widget.getBoundingBox();