a-frame-components
Advanced tools
Comparing version 1.0.277 to 1.0.278
@@ -88,3 +88,2 @@ import { Text } from 'troika-three-text'; | ||
var _this = this; | ||
var me = this; | ||
// If we're being applied as a component attached to a generic a-entity, create an | ||
@@ -103,2 +102,3 @@ // anonymous sub-entity that we can use to isolate the text mesh and the material | ||
this.troikaTextEntity = textEntity; | ||
var me = this; | ||
// Create Text mesh and add it to the entity as the 'mesh' object | ||
@@ -116,11 +116,9 @@ var textMesh = this.troikaTextMesh = new Text(); | ||
if (_this.data.beingEdited) { | ||
me.placeCursor(); | ||
_this.placeCursor(); | ||
} | ||
} | ||
if ((_a = textMesh === null || textMesh === void 0 ? void 0 : textMesh.geometry) === null || _a === void 0 ? void 0 : _a.boundingBox) { | ||
me.el.emit('bounding-box-update', { box: (_b = textMesh === null || textMesh === void 0 ? void 0 : textMesh.geometry) === null || _b === void 0 ? void 0 : _b.boundingBox }); | ||
} | ||
_this.troikaTextEntity.setObject3D('mesh', group); | ||
if ((_b = (_a = me === null || me === void 0 ? void 0 : me.troikaTextMesh) === null || _a === void 0 ? void 0 : _a.geometry) === null || _b === void 0 ? void 0 : _b.boundingBox) { | ||
me.el.emit('bounding-box-update', { | ||
box: me.troikaTextMesh.geometry.boundingBox | ||
}); | ||
} | ||
}); | ||
@@ -235,4 +233,4 @@ }, | ||
var _a, _b; | ||
if ((_b = (_a = me === null || me === void 0 ? void 0 : me.troikaTextMesh) === null || _a === void 0 ? void 0 : _a.geometry) === null || _b === void 0 ? void 0 : _b.boundingBox) { | ||
me.el.emit('bounding-box-update', { box: me.troikaTextMesh.geometry.boundingBox }); | ||
if ((_a = mesh === null || mesh === void 0 ? void 0 : mesh.geometry) === null || _a === void 0 ? void 0 : _a.boundingBox) { | ||
me.el.emit('bounding-box-update', { box: (_b = mesh === null || mesh === void 0 ? void 0 : mesh.geometry) === null || _b === void 0 ? void 0 : _b.boundingBox }); | ||
} | ||
@@ -239,0 +237,0 @@ }); |
{ | ||
"name": "a-frame-components", | ||
"version": "1.0.277", | ||
"version": "1.0.278", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -93,3 +93,2 @@ import { Text } from 'troika-three-text' | ||
init: function () { | ||
let me = this; | ||
// If we're being applied as a component attached to a generic a-entity, create an | ||
@@ -107,2 +106,3 @@ // anonymous sub-entity that we can use to isolate the text mesh and the material | ||
this.troikaTextEntity = textEntity | ||
let me = this; | ||
// Create Text mesh and add it to the entity as the 'mesh' object | ||
@@ -120,11 +120,9 @@ var textMesh = this.troikaTextMesh = new Text() | ||
if (this.data.beingEdited) { | ||
me.placeCursor() | ||
this.placeCursor() | ||
} | ||
} | ||
if (textMesh?.geometry?.boundingBox) { | ||
me.el.emit('bounding-box-update', { box: textMesh?.geometry?.boundingBox }) | ||
} | ||
this.troikaTextEntity.setObject3D('mesh', group); | ||
if (me?.troikaTextMesh?.geometry?.boundingBox) { | ||
me.el.emit('bounding-box-update', { | ||
box: me.troikaTextMesh.geometry.boundingBox | ||
}) | ||
} | ||
}); | ||
@@ -238,8 +236,8 @@ }, | ||
mesh._needsSync = true; | ||
mesh.sync(() => { | ||
if (me?.troikaTextMesh?.geometry?.boundingBox) { | ||
me.el.emit('bounding-box-update', { box: me.troikaTextMesh.geometry.boundingBox }) | ||
if (mesh?.geometry?.boundingBox) { | ||
me.el.emit('bounding-box-update', { box: mesh?.geometry?.boundingBox }) | ||
} | ||
}); | ||
this.positionCaret(); | ||
@@ -246,0 +244,0 @@ // Pass material config down to child entity |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1763756
30088