Skip to content

Commit d8a3b82

Browse files
committed
fix: updating disabled updates material color param (#7961)
1 parent 99c96dd commit d8a3b82

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/extras/gizmo/shape/shape.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,8 @@ class Shape {
210210
* @type {boolean}
211211
*/
212212
set disabled(value) {
213-
const color = value ? this._disabledColor : this._defaultColor;
214-
this._material.setParameter('uColor', color.toArray());
215213
this._disabled = value ?? false;
214+
this.hover(false);
216215
}
217216

218217
/**
@@ -294,10 +293,8 @@ class Shape {
294293
* @returns {void}
295294
*/
296295
hover(state) {
297-
if (this._disabled) {
298-
return;
299-
}
300-
const color = state ? this._hoverColor : this._defaultColor;
296+
const color = this._disabled ?
297+
this._disabledColor : state ? this._hoverColor : this._defaultColor;
301298
this._material.setParameter('uColor', color.toArray());
302299
}
303300

0 commit comments

Comments
 (0)