simulationjsv2 0.5.1 → 0.5.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.
Files changed (2) hide show
  1. package/dist/graphics.js +6 -3
  2. package/package.json +1 -1
package/dist/graphics.js CHANGED
@@ -546,15 +546,18 @@ export class Line2d extends SimulationElement2d {
546
546
  return this.moveTo(pos, t, f);
547
547
  }
548
548
  setEnd(pos, t = 0, f) {
549
+ const tempPos = cloneBuf(pos);
550
+ vector2ToPixelRatio(tempPos);
551
+ vec2.sub(tempPos, this.getPos(), tempPos);
549
552
  const diff = vector3();
550
- vec2.sub(pos, this.to, diff);
553
+ vec2.sub(tempPos, this.to, diff);
551
554
  return transitionValues((p) => {
552
555
  this.to[0] += diff[0] * p;
553
556
  this.to[1] += diff[1] * p;
554
557
  this.vertexCache.updated();
555
558
  }, () => {
556
- this.to[0] = pos[0];
557
- this.to[1] = pos[1];
559
+ this.to[0] = tempPos[0];
560
+ this.to[1] = tempPos[1];
558
561
  this.vertexCache.updated();
559
562
  }, t, f);
560
563
  }
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Jackson Otto",
7
7
  "description": "A simple graphics library using WebGPU",
8
- "version": "0.5.1",
8
+ "version": "0.5.2",
9
9
  "exports": {
10
10
  ".": {
11
11
  "import": "./dist/index.js",