@zcomponent/core 1.29.0 → 1.29.1-beta.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.
package/lib/animation/layer.js
CHANGED
|
@@ -175,6 +175,11 @@ export class Layer {
|
|
|
175
175
|
break;
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
+
// If this clip is already in the queue (still fading out from a previous
|
|
179
|
+
// switch), remove that old entry before re-adding it, so the same LayerClip
|
|
180
|
+
// is never queued twice. Otherwise, when tick() later cleans up the old
|
|
181
|
+
// entry, it pauses the clip - which is now also the active one - freezing it.
|
|
182
|
+
this._queue = this._queue.filter(entry => entry === this._active || entry.layerClip !== layerClip);
|
|
178
183
|
const entry = this.queue(layerClip, {
|
|
179
184
|
...playOptions,
|
|
180
185
|
fade: playOptions?.fade !== undefined ? playOptions.fade : this._active === undefined || layerClip === undefined ? { time: 0, easing: null } : undefined,
|
|
@@ -161,7 +161,18 @@ export class StreamTrack extends Track {
|
|
|
161
161
|
}
|
|
162
162
|
else {
|
|
163
163
|
const [bt, loopNumber] = resolveClipTimeLoops(t, block.t0, block.s0, block.rate, this.stream?.length?.() ?? Infinity, rate * block.rate < 0, block.t1);
|
|
164
|
-
if (
|
|
164
|
+
if (block.t1 !== undefined && block.t1 === block.t0) {
|
|
165
|
+
// Zero-length (state) block: seek to its start offset and hold. Without
|
|
166
|
+
// this the boundary check below pauses before seeking, so the state
|
|
167
|
+
// never applies (e.g. a "reset" streamed from a sub-component).
|
|
168
|
+
if (this._lastLoopNumber !== loopNumber || lastBlock !== block) {
|
|
169
|
+
this._lastLoopNumber = loopNumber;
|
|
170
|
+
force = true;
|
|
171
|
+
this.stream?.seek(block.s0);
|
|
172
|
+
}
|
|
173
|
+
desiredState = StreamState.Paused;
|
|
174
|
+
}
|
|
175
|
+
else if ((t === block.t1 && rate >= +0) || (t === block.t0 && rate < 0)) {
|
|
165
176
|
desiredState = StreamState.Paused;
|
|
166
177
|
force = true;
|
|
167
178
|
}
|