@abi-software/scaffoldvuer 1.13.0 → 1.13.1-beta.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/scaffoldvuer",
3
- "version": "1.13.0",
3
+ "version": "1.13.1-beta.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1175,6 +1175,14 @@ export default {
1175
1175
  }
1176
1176
  }
1177
1177
  }
1178
+ //Recalculate the following if module is ready
1179
+ if (this.isReady) {
1180
+ const {centre, size} = this.$module.getCentreAndSize();
1181
+ this.boundingDims.centre = centre;
1182
+ this.boundingDims.size = size;
1183
+ }
1184
+
1185
+
1178
1186
  /**
1179
1187
  * Emit when a new object is added to the scene
1180
1188
  * @arg {Object} "The object added to the sceene"
@@ -149,24 +149,30 @@ export default {
149
149
  watch: {
150
150
  boundingDims: {
151
151
  handler: function (value) {
152
- const centre = value.centre;
153
- const size = value.size;
154
- this.min = [
155
- centre[0] - size[0],
156
- centre[1] - size[1],
157
- centre[2] - size[2]
158
- ];
159
- this.max = [
160
- centre[0] + size[0],
161
- centre[1] + size[1],
162
- centre[2] + size[2]
163
- ];
152
+ this.calculateMinAndMax();
164
153
  },
165
154
  immediate: true,
166
155
  deep: true,
167
156
  },
168
157
  },
169
158
  methods: {
159
+ calculateMinAndMax: function() {
160
+ if (this.zincObject) {
161
+ const originalPos = this.zincObject?.userData?.originalPos;
162
+ if (originalPos && this.boundingDims) {
163
+ this.min = [
164
+ originalPos[0] - this.boundingDims.size[0],
165
+ originalPos[1] - this.boundingDims.size[1],
166
+ originalPos[2] - this.boundingDims.size[2]
167
+ ];
168
+ this.max = [
169
+ originalPos[0] + this.boundingDims.size[0],
170
+ originalPos[1] + this.boundingDims.size[1],
171
+ originalPos[2] + this.boundingDims.size[2]
172
+ ];
173
+ }
174
+ }
175
+ },
170
176
  setObject: function (object) {
171
177
  if (object.isZincObject) {
172
178
  this.zincObject = markRaw(object);
@@ -182,18 +188,7 @@ export default {
182
188
  this.scale = morph.scale.x;
183
189
  }
184
190
  this.enableScaling = this.zincObject.isTextureSlides ? false : true;
185
- if (originalPos && this.boundingDims) {
186
- this.min = [
187
- originalPos[0] - this.boundingDims.size[0],
188
- originalPos[1] - this.boundingDims.size[1],
189
- originalPos[2] - this.boundingDims.size[2]
190
- ];
191
- this.max = [
192
- originalPos[0] + this.boundingDims.size[0],
193
- originalPos[1] + this.boundingDims.size[1],
194
- originalPos[2] + this.boundingDims.size[2]
195
- ];
196
- }
191
+ this.calculateMinAndMax();
197
192
  }
198
193
  } else {
199
194
  this.zincObject = undefined;