Skip to content

Commit

Permalink
Fix breaking change introduced in #15126 (#15818)
Browse files Browse the repository at this point in the history
  • Loading branch information
Popov72 authored Nov 14, 2024
1 parent 7edccd2 commit 7b7f4d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/dev/core/src/Animations/animatable.core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,9 @@ export class Animatable {
/**
* Jump directly to a given frame
* @param frame defines the frame to jump to
* @param useWeight defines whether the animation weight should be applied to the image to be jumped to (false by default)
*/
public goToFrame(frame: number): void {
public goToFrame(frame: number, useWeight = false): void {
const runtimeAnimations = this._runtimeAnimations;

if (runtimeAnimations[0]) {
Expand All @@ -295,7 +296,7 @@ export class Animatable {
}

for (let index = 0; index < runtimeAnimations.length; index++) {
runtimeAnimations[index].goToFrame(frame, this._weight);
runtimeAnimations[index].goToFrame(frame, useWeight ? this._weight : -1);
}

this._goToFrame = frame;
Expand Down
5 changes: 3 additions & 2 deletions packages/dev/core/src/Animations/animationGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -850,16 +850,17 @@ export class AnimationGroup implements IDisposable {
/**
* Goes to a specific frame in this animation group. Note that the animation group must be in playing or paused status
* @param frame the frame number to go to
* @param useWeight defines whether the animation weight should be applied to the image to be jumped to (false by default)
* @returns the animationGroup
*/
public goToFrame(frame: number): AnimationGroup {
public goToFrame(frame: number, useWeight = false): AnimationGroup {
if (!this._isStarted) {
return this;
}

for (let index = 0; index < this._animatables.length; index++) {
const animatable = this._animatables[index];
animatable.goToFrame(frame);
animatable.goToFrame(frame, useWeight);
}

return this;
Expand Down

0 comments on commit 7b7f4d8

Please sign in to comment.