@shopware-ag/dive 1.6.0 → 1.6.1

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": "@shopware-ag/dive",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "Shopware Spatial Framework",
5
5
  "type": "module",
6
6
  "main": "./build/dive.cjs",
@@ -97,7 +97,7 @@ export default class DIVEModel extends Object3D implements DIVESelectable, DIVEM
97
97
  const worldPos = mesh.localToWorld(meshBB.max.clone());
98
98
 
99
99
  const oldPos = this.position.clone();
100
- const newPos = this.position.clone().setY(worldPos.y).add(new Vector3(0, bottomY, 0));
100
+ const newPos = this.position.clone().setY(worldPos.y).sub(new Vector3(0, bottomY, 0));
101
101
  this.position.copy(newPos);
102
102
 
103
103
  // if the position changed, update the object in communication
@@ -43,6 +43,12 @@ jest.mock('three', () => {
43
43
  this.z += vec3.z;
44
44
  return this;
45
45
  };
46
+ this.sub = (vec3: Vector3) => {
47
+ this.x -= vec3.x;
48
+ this.y -= vec3.y;
49
+ this.z -= vec3.z;
50
+ return this;
51
+ };
46
52
  return this;
47
53
  }),
48
54
  Object3D: jest.fn(function () {
@@ -63,6 +69,7 @@ jest.mock('three', () => {
63
69
  },
64
70
  }
65
71
  this.add = jest.fn();
72
+ this.sub = jest.fn();
66
73
  this.children = [{
67
74
  visible: true,
68
75
  material: {
@@ -278,7 +285,7 @@ describe('dive/model/DIVEModel', () => {
278
285
  model.parent = scene.Root;
279
286
 
280
287
  expect(() => model.DropIt()).not.toThrow();
281
- expect(model.position.y).toBe(1.5);
288
+ expect(model.position.y).toBe(2.5);
282
289
  expect(comMock.PerformAction).toHaveBeenCalledTimes(1);
283
290
 
284
291
  expect(() => model.DropIt()).not.toThrow();