@tscircuit/3d-viewer 0.0.347 → 0.0.348
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.
- package/dist/index.js +6 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -25455,11 +25455,12 @@ var Html = ({ children, position, style }) => {
|
|
|
25455
25455
|
if (!camera || !el.current || !renderer) return;
|
|
25456
25456
|
const vector = new THREE5.Vector3(...position);
|
|
25457
25457
|
vector.project(camera);
|
|
25458
|
-
const
|
|
25459
|
-
const
|
|
25458
|
+
const rect = renderer.domElement.getBoundingClientRect();
|
|
25459
|
+
const x = Math.round((vector.x + 1) / 2 * rect.width);
|
|
25460
|
+
const y = Math.round((-vector.y + 1) / 2 * rect.height);
|
|
25460
25461
|
el.current.style.position = "absolute";
|
|
25461
|
-
el.current.style.left = `${x}px`;
|
|
25462
|
-
el.current.style.top = `${y}px`;
|
|
25462
|
+
el.current.style.left = `${rect.left + x}px`;
|
|
25463
|
+
el.current.style.top = `${rect.top + y}px`;
|
|
25463
25464
|
el.current.style.pointerEvents = "none";
|
|
25464
25465
|
if (style) {
|
|
25465
25466
|
Object.assign(el.current.style, style);
|
|
@@ -25582,7 +25583,7 @@ import * as THREE10 from "three";
|
|
|
25582
25583
|
// package.json
|
|
25583
25584
|
var package_default = {
|
|
25584
25585
|
name: "@tscircuit/3d-viewer",
|
|
25585
|
-
version: "0.0.
|
|
25586
|
+
version: "0.0.347",
|
|
25586
25587
|
main: "./dist/index.js",
|
|
25587
25588
|
module: "./dist/index.js",
|
|
25588
25589
|
type: "module",
|