File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -339,8 +339,7 @@ this.createjs = this.createjs||{};
339339 * is `false`).
340340 **/
341341 p . setPosition = function ( value , actionsMode ) {
342- if ( value < 0 ) { value = 0 ; }
343- var t = this . loop ? value % this . duration : value ;
342+ var t = this . _calcPosition ( value ) ;
344343 var end = ! this . loop && value >= this . duration ;
345344 if ( t == this . _prevPos ) { return end ; }
346345 this . _prevPosition = value ;
@@ -420,13 +419,25 @@ this.createjs = this.createjs||{};
420419// private methods:
421420 /**
422421 * @method _goto
422+ * @param {String | Number } positionOrLabel
423423 * @protected
424424 **/
425425 p . _goto = function ( positionOrLabel ) {
426426 var pos = this . resolve ( positionOrLabel ) ;
427427 if ( pos != null ) { this . setPosition ( pos ) ; }
428428 } ;
429-
429+
430+ /**
431+ * @method _calcPosition
432+ * @param {Number } value
433+ * @return {Number }
434+ * @protected
435+ **/
436+ p . _calcPosition = function ( value ) {
437+ if ( value < 0 ) { return 0 ; }
438+ if ( value < this . duration ) { return value ; }
439+ return this . loop ? value % this . duration : this . duration ;
440+ } ;
430441
431442 createjs . Timeline = createjs . promote ( Timeline , "EventDispatcher" ) ;
432443
You can’t perform that action at this time.
0 commit comments