coily 0.10.0 → 0.10.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/dist/api.mjs +3 -6
- package/package.json +2 -3
package/dist/api.mjs
CHANGED
|
@@ -331,12 +331,12 @@ class Spring {
|
|
|
331
331
|
options.precision === void 0 || options.precision > 0,
|
|
332
332
|
"Precision must be greater than 0"
|
|
333
333
|
);
|
|
334
|
-
this.#target = options.target ?? 0;
|
|
334
|
+
this.#target = options.target ?? options.value ?? 0;
|
|
335
335
|
this.#solver = new Solver({
|
|
336
336
|
mass: options.mass,
|
|
337
337
|
tension: options.tension,
|
|
338
338
|
damping: options.damping,
|
|
339
|
-
position:
|
|
339
|
+
position: (options.value ?? this.#target) - this.#target,
|
|
340
340
|
velocity: 0,
|
|
341
341
|
precision: options.precision ?? 2
|
|
342
342
|
});
|
|
@@ -447,10 +447,7 @@ class SpringSystemImpl {
|
|
|
447
447
|
this.#scheduler = new Scheduler();
|
|
448
448
|
}
|
|
449
449
|
createSpring(options) {
|
|
450
|
-
return new Spring(this.#scheduler,
|
|
451
|
-
...options,
|
|
452
|
-
target: options.target ?? 0
|
|
453
|
-
});
|
|
450
|
+
return new Spring(this.#scheduler, options);
|
|
454
451
|
}
|
|
455
452
|
tick(dt) {
|
|
456
453
|
this.#scheduler.tick(dt);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coily",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "Simulate values using spring physics",
|
|
5
5
|
"author": "Tim Morris <timthewebguy@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/tkofh/coily#readme",
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "unbuild",
|
|
45
|
-
"test": "vitest run"
|
|
46
|
-
"prepublish": "bun run build"
|
|
45
|
+
"test": "vitest run"
|
|
47
46
|
}
|
|
48
47
|
}
|