endset_three_editor 0.5.4 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1993,7 +1993,7 @@ class dt {
1993
1993
  items: e.items || [],
1994
1994
  offsetY: e.offsetY ?? 0.1,
1995
1995
  fontSize: e.fontSize || "13px",
1996
- width: e.width || "240px",
1996
+ width: e.width || "220px",
1997
1997
  backgroundColor: e.backgroundColor || "linear-gradient(135deg, rgba(6, 16, 42, 0.55) 0%, rgba(2, 6, 18, 0.40) 100%)",
1998
1998
  textColor: e.textColor || "#ffffff",
1999
1999
  borderColor: e.borderColor || "rgba(80, 200, 255, 0.15)",
@@ -2083,10 +2083,12 @@ class dt {
2083
2083
  */
2084
2084
  attachTo(e) {
2085
2085
  this.attachedObject && this.attachedObject !== e && this.detach();
2086
- const t = new w.Box3().setFromObject(e), n = new w.Vector3();
2087
- t.getSize(n);
2088
- const s = n.y / 2 + this.options.offsetY;
2089
- this.css2dObject || (this.css2dObject = new Ji(this.container), this.css2dObject.name = `DataPanel_${e.name || e.uuid}`, this.css2dObject.center.set(0.5, 1)), this.css2dObject.position.set(0, s, 0), e.add(this.css2dObject), this.attachedObject = e;
2086
+ const t = new w.Vector3();
2087
+ e.getWorldPosition(t);
2088
+ const n = new w.Box3().setFromObject(e), s = new w.Vector3(), i = new w.Vector3();
2089
+ n.getCenter(s), n.getSize(i);
2090
+ const a = n.max.y - t.y + this.options.offsetY;
2091
+ this.css2dObject || (this.css2dObject = new Ji(this.container), this.css2dObject.name = `DataPanel_${e.name || e.uuid}`, this.css2dObject.center.set(0.5, 1)), this.css2dObject.position.set(0, a, 0), e.add(this.css2dObject), this.attachedObject = e;
2090
2092
  }
2091
2093
  /**
2092
2094
  * 从附着的物体上移除面板