@vectojs/three 0.1.0 → 0.1.2
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 +3 -3
- package/dist/index.mjs +4 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -590,8 +590,8 @@ var ThreeAdapter = class {
|
|
|
590
590
|
* Dispatches pointer events mapped from UV coordinates [0, 1] to VectoJS entities.
|
|
591
591
|
*/
|
|
592
592
|
dispatchAtUv(type, uv, pointerId, originalEvent) {
|
|
593
|
-
const px = uv.x * this.
|
|
594
|
-
const py = (1 - uv.y) * this.
|
|
593
|
+
const px = uv.x * this.vectoScene.width;
|
|
594
|
+
const py = (1 - uv.y) * this.vectoScene.height;
|
|
595
595
|
this.vectoScene.markDirty();
|
|
596
596
|
const hitEntity = this.vectoScene.findEntityAt(px, py);
|
|
597
597
|
const state = this.activePointers.get(pointerId);
|
|
@@ -630,7 +630,7 @@ var ThreeAdapter = class {
|
|
|
630
630
|
*/
|
|
631
631
|
dispatchEventToTarget(entity, type, x, y, pointerId, originalEvent) {
|
|
632
632
|
const a11yEl = this.vectoScene.getA11yElement(entity.id);
|
|
633
|
-
if (a11yEl) {
|
|
633
|
+
if (a11yEl && a11yEl.isConnected) {
|
|
634
634
|
const domEvent = this.createDOMEvent(type, x, y, pointerId, originalEvent);
|
|
635
635
|
a11yEl.dispatchEvent(domEvent);
|
|
636
636
|
if (type === "pointerdown" && (a11yEl instanceof HTMLInputElement || a11yEl instanceof HTMLTextAreaElement || a11yEl.getAttribute("tabindex") !== null)) {
|
package/dist/index.mjs
CHANGED
|
@@ -478,10 +478,7 @@ var ThreeRenderer = class {
|
|
|
478
478
|
|
|
479
479
|
// src/ThreeAdapter.ts
|
|
480
480
|
import * as THREE2 from "three";
|
|
481
|
-
import {
|
|
482
|
-
Scene as VectoScene,
|
|
483
|
-
VectoJSEvent
|
|
484
|
-
} from "@vectojs/core";
|
|
481
|
+
import { Scene as VectoScene, VectoJSEvent } from "@vectojs/core";
|
|
485
482
|
var ThreeAdapter = class {
|
|
486
483
|
/** The Three.js CanvasTexture wrapping the offscreen Vecto canvas. */
|
|
487
484
|
texture;
|
|
@@ -555,8 +552,8 @@ var ThreeAdapter = class {
|
|
|
555
552
|
* Dispatches pointer events mapped from UV coordinates [0, 1] to VectoJS entities.
|
|
556
553
|
*/
|
|
557
554
|
dispatchAtUv(type, uv, pointerId, originalEvent) {
|
|
558
|
-
const px = uv.x * this.
|
|
559
|
-
const py = (1 - uv.y) * this.
|
|
555
|
+
const px = uv.x * this.vectoScene.width;
|
|
556
|
+
const py = (1 - uv.y) * this.vectoScene.height;
|
|
560
557
|
this.vectoScene.markDirty();
|
|
561
558
|
const hitEntity = this.vectoScene.findEntityAt(px, py);
|
|
562
559
|
const state = this.activePointers.get(pointerId);
|
|
@@ -595,7 +592,7 @@ var ThreeAdapter = class {
|
|
|
595
592
|
*/
|
|
596
593
|
dispatchEventToTarget(entity, type, x, y, pointerId, originalEvent) {
|
|
597
594
|
const a11yEl = this.vectoScene.getA11yElement(entity.id);
|
|
598
|
-
if (a11yEl) {
|
|
595
|
+
if (a11yEl && a11yEl.isConnected) {
|
|
599
596
|
const domEvent = this.createDOMEvent(type, x, y, pointerId, originalEvent);
|
|
600
597
|
a11yEl.dispatchEvent(domEvent);
|
|
601
598
|
if (type === "pointerdown" && (a11yEl instanceof HTMLInputElement || a11yEl instanceof HTMLTextAreaElement || a11yEl.getAttribute("tabindex") !== null)) {
|