@doki-land/live2d-widget 0.0.17 → 0.0.19
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/index.js +2 -2
- package/package.json +2 -2
- package/src/shell/widget.ts +2 -4
package/dist/index.js
CHANGED
|
@@ -306,7 +306,7 @@ var Live2DWidget = class {
|
|
|
306
306
|
this.#chrome?.tips?.show(text, timeoutMs, priority);
|
|
307
307
|
}
|
|
308
308
|
#parameterFromNormalized(id, normalized) {
|
|
309
|
-
const binding = this.#runtime?.
|
|
309
|
+
const binding = this.#runtime?.parameterMap().get(id);
|
|
310
310
|
if (!binding) return normalized;
|
|
311
311
|
return normalized >= 0 ? binding.defaultValue + (binding.max - binding.defaultValue) * normalized : binding.defaultValue + (binding.defaultValue - binding.min) * normalized;
|
|
312
312
|
}
|
|
@@ -326,7 +326,7 @@ var Live2DWidget = class {
|
|
|
326
326
|
if (!p || !runtime) return;
|
|
327
327
|
this.#autoSwayPausedByPointer = true;
|
|
328
328
|
for (const { id, value } of focusParameterUpdates(
|
|
329
|
-
runtime.
|
|
329
|
+
runtime.parameterMap(),
|
|
330
330
|
p.x,
|
|
331
331
|
p.y
|
|
332
332
|
)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doki-land/live2d-widget",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"description": "Live2D page widget — canvas shell, autoplay, optional tips chrome; built on @doki-land/live2d.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"test": "vitest run --passWithNoTests"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@doki-land/live2d": "0.0.
|
|
45
|
+
"@doki-land/live2d": "0.0.19"
|
|
46
46
|
},
|
|
47
47
|
"sideEffects": false
|
|
48
48
|
}
|
package/src/shell/widget.ts
CHANGED
|
@@ -137,9 +137,7 @@ export class Live2DWidget {
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
#parameterFromNormalized(id: string, normalized: number): number {
|
|
140
|
-
const binding = this.#runtime
|
|
141
|
-
?.listParameters()
|
|
142
|
-
.find((p) => p.id === id);
|
|
140
|
+
const binding = this.#runtime?.parameterMap().get(id);
|
|
143
141
|
if (!binding) return normalized;
|
|
144
142
|
return normalized >= 0
|
|
145
143
|
? binding.defaultValue +
|
|
@@ -166,7 +164,7 @@ export class Live2DWidget {
|
|
|
166
164
|
// Pointer tracking overrides auto-sway for ANGLE_X while moving.
|
|
167
165
|
this.#autoSwayPausedByPointer = true;
|
|
168
166
|
for (const { id, value } of focusParameterUpdates(
|
|
169
|
-
runtime.
|
|
167
|
+
runtime.parameterMap(),
|
|
170
168
|
p.x,
|
|
171
169
|
p.y,
|
|
172
170
|
)) {
|