From 39d71b3ef7632e135f1526b313d455bde130b7bc Mon Sep 17 00:00:00 2001 From: Kevin Levron Date: Wed, 16 Feb 2022 19:52:11 +0100 Subject: [PATCH] created event for geometries --- src/geometries/Geometry.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/geometries/Geometry.ts b/src/geometries/Geometry.ts index 26cb21d..62bbf40 100644 --- a/src/geometries/Geometry.ts +++ b/src/geometries/Geometry.ts @@ -22,6 +22,7 @@ export interface GeometryAttributeInterface { // } const Geometry = defineComponent({ + emits: ['created'], props: { rotateX: Number, rotateY: Number, @@ -64,7 +65,9 @@ const Geometry = defineComponent({ } }) geometry.computeBoundingBox() + geometry.userData.component = this this.geometry = geometry + this.$emit('created', geometry) }, rotateGeometry() { if (!this.geometry) return @@ -98,6 +101,8 @@ export function geometryComponent

>( methods: { createGeometry() { this.geometry = createGeometry(this) + this.geometry.userData.component = this + this.$emit('created', this.geometry) }, }, })