fix ghost/wire/solid toggle states
This commit is contained in:
parent
84bf821c6d
commit
130a1c498b
1 changed files with 14 additions and 2 deletions
|
|
@ -262,6 +262,10 @@ class KeyboardControl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let api = this.#api;
|
||||||
|
let isWireframe = api.local.getBoolean('model.wireframe');
|
||||||
|
let isGhost = api.local.getFloat('model.wireframe.opacity') < 1;
|
||||||
|
|
||||||
switch (evt.keyCode) {
|
switch (evt.keyCode) {
|
||||||
case this.#cca('`'): this.#api.show.slices(0); break;
|
case this.#cca('`'): this.#api.show.slices(0); break;
|
||||||
case this.#cca('0'): {
|
case this.#cca('0'): {
|
||||||
|
|
@ -398,10 +402,18 @@ class KeyboardControl {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case this.#cca('w'): // set ghost
|
case this.#cca('w'): // set ghost
|
||||||
|
if (isGhost && !isWireframe) {
|
||||||
|
$('render-solid').onclick();
|
||||||
|
} else {
|
||||||
$('render-ghost').onclick();
|
$('render-ghost').onclick();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case this.#cca('W'): // set wireframe
|
case this.#cca('W'): // set wireframe
|
||||||
|
if (isWireframe) {
|
||||||
|
$('render-solid').onclick();
|
||||||
|
} else {
|
||||||
$('render-wire').onclick();
|
$('render-wire').onclick();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
this.#onUnhandledKey(evt);
|
this.#onUnhandledKey(evt);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue