Skip to content

Commit

Permalink
Converting dot Utils usage, see phetsims/dot#4
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Feb 14, 2025
1 parent 2398d6d commit 37e18ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/Animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import Emitter from '../../axon/js/Emitter.js';
import stepTimer from '../../axon/js/stepTimer.js';
import { TReadOnlyEmitter } from '../../axon/js/TEmitter.js';
import TinyEmitter from '../../axon/js/TinyEmitter.js';
import Utils from '../../dot/js/Utils.js';
import optionize from '../../phet-core/js/optionize.js';
import AnimationTarget, { AnimationTargetOptions } from './AnimationTarget.js';
import twixt from './twixt.js';
import { clamp } from '../../dot/js/util/clamp.js';

type SelfOptions<TargetTypes, TargetObjectTypes extends { [K in keyof TargetTypes]: unknown }> = {
// Can be provided instead of setValue/property/object, and it contains an array of config-style objects that allows
Expand Down Expand Up @@ -314,7 +314,7 @@ class Animation<SelfType = unknown, SelfObjectType = unknown, TargetTypes = unkn
dt = -this.remainingAnimation; // record how far past the animation we go

assert && assert( this.length !== null );
const ratio = this.length! > 0 ? Utils.clamp( ( this.length! - this.remainingAnimation ) / this.length!, 0, 1 ) : 1;
const ratio = this.length! > 0 ? clamp( ( this.length! - this.remainingAnimation ) / this.length!, 0, 1 ) : 1;
for ( let j = 0; j < this.targets.length; j++ ) {
this.targets[ j ].update( ratio );
}
Expand Down

0 comments on commit 37e18ba

Please sign in to comment.