Browse Source

divie by 0

master
cailean 51 minutes ago
parent
commit
5aebbd6d4a
  1. 7
      js/Item.js

7
js/Item.js

@ -436,8 +436,11 @@ export class Item {
this.hoverIndicator.scale.set(desiredScale, desiredScale, desiredScale); this.hoverIndicator.scale.set(desiredScale, desiredScale, desiredScale);
// Counteract the parent's scale by dividing the indicator's scale by the parent's scale. // Counteract the parent's scale by dividing the indicator's scale by the parent's scale.
if (this.object.scale.x !== 0 && this.object.scale.y !== 0 && this.object.scale.z !== 0) { if (scale.x !== 0 && scale.y !== 0 && scale.z !== 0) {
this.hoverIndicator.scale.divide(this.object.scale); this.hoverIndicator.scale.divide(scale);
} else {
// Avoid division by zero
this.hoverIndicator.scale.set(1, 1, 1);
} }
// Position the sprite at the center of the object, in local space. // Position the sprite at the center of the object, in local space.

Loading…
Cancel
Save