ghost mode in slice/preview uses gray instead of a color to better show lines

This commit is contained in:
Stewart Allen 2022-01-23 17:21:20 -05:00
commit 837f584907
3 changed files with 15 additions and 7 deletions

View file

@ -501,14 +501,16 @@ console.log/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
/**
* @param {number} color
*/
PRO.setColor = function(color,settings) {
PRO.setColor = function(color, settings, save = true) {
if (settings) {
console.trace('legacy call with settings');
}
if (Array.isArray(color)) {
color = color[this.getExtruder() % color.length];
}
this.color = color;
if (save) {
this.color = color;
}
let material = this.mesh.material;
material.color.set(color);
};
@ -953,6 +955,11 @@ console.log/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
let wire = widget.wire = new THREE.LineSegments(geo, mat);
mesh.add(wire);
}
if (KIRI.api.view.get() === KIRI.conf.VIEWS.ARRANGE) {
this.setColor(this.color);
} else {
this.setColor(0x888888,undefined,false);
}
if (opacity !== undefined) {
widget.setOpacity(opacity);
}