fix ball taper render in indexed mode

This commit is contained in:
Stewart Allen 2025-12-12 22:26:58 -05:00
commit d5cda790c0
8 changed files with 38 additions and 31 deletions

View file

@ -73,7 +73,7 @@ function prepareSlices(callback, scale = 1, offset = 0) {
let totalProgress;
api.widgets.opacity(COLOR.slicing_opacity);
api.widgets.setOpacity(COLOR.slicing_opacity);
let segtimes = {},
segNumber = 0,
@ -325,12 +325,10 @@ function preparePreview(callback, scale = 1, offset = 0) {
event.emit('preview.begin', pMode);
if (isCam) {
api.widgets.opacity(isDark ? COLOR.cam_preview_opacity_dark : COLOR.cam_preview_opacity);
api.widgets.each(widget => {
widget.setColor(COLOR.cam_preview);
});
api.widgets.setOpacity(isDark ? COLOR.cam_preview_opacity_dark : COLOR.cam_preview_opacity);
api.widgets.setColor(COLOR.cam_preview);
} else if (offset === 0) {
api.widgets.opacity(COLOR.preview_opacity);
api.widgets.setOpacity(COLOR.preview_opacity);
}
let mark = Date.now(),
@ -374,7 +372,7 @@ function preparePreview(callback, scale = 1, offset = 0) {
show.progress(0);
if (!isCam) {
api.widgets.opacity(0);
api.widgets.setOpacity(0);
}
if (output.length) {
@ -463,7 +461,7 @@ function parseCode(code, type) {
event.emit("code.load", {code, type});
view.set_preview();
widgets.opacity(0);
widgets.setOpacity(0);
client.parse({code, type, settings}, progress => {
show.progress(progress, "parsing");

View file

@ -361,7 +361,7 @@ function updateSliderMax(set) {
function hideSlices() {
STACKS.clear();
api.widgets.opacity(COLOR.model_opacity);
api.widgets.setOpacity(COLOR.model_opacity);
api.widgets.each(function(widget) {
widget.setWireframe(false);
});
@ -804,7 +804,7 @@ function setViewMode(mode) {
updateSpeeds();
setVisibleLayer();
setWidgetVisibility(true);
api.widgets.opacity(1);
api.widgets.setOpacity(1);
api.view.edges(api.local.getBoolean('model.edges'));
break;
case VIEWS.SLICE:

View file

@ -82,7 +82,7 @@ function meshes() {
return out;
}
function opacity(value) {
function setOpacity(value) {
api.widgets.each(w => w.setOpacity(value));
api.space.update();
}
@ -103,16 +103,18 @@ export const widgets = {
meshes,
rename,
replace,
opacity,
opacity(o) { setOpacity(o); console.trace('opacity() deprecated') },
annotate,
setIndexed,
setAxisIndex,
all() { return WIDGETS.slice() },
add(w) { return WIDGETS.push(w) },
remove(w) { return WIDGETS.remove(w) },
filter(fn) { return WIDGETS = WIDGETS.filter(fn) },
count() { return WIDGETS.length },
each(fn) { WIDGETS.slice().forEach(widget => fn(widget)) },
for(fn) { widgets.each(fn) },
forid(id) { return WIDGETS.filter(w => w.id === id)[0] }
setColor(c,s) { api.widgets.each(widget => widget.setColor(c,undefined,s) )},
setOpacity,
all() { return WIDGETS.slice() },
add(w) { return WIDGETS.push(w) },
remove(w) { return WIDGETS.remove(w) },
filter(fn) { return WIDGETS = WIDGETS.filter(fn) },
count() { return WIDGETS.length },
each(fn) { WIDGETS.slice().forEach(widget => fn(widget)) },
for(fn) { widgets.each(fn) },
forid(id) { return WIDGETS.filter(w => w.id === id)[0] }
};