@@ -58,6 +58,7 @@ cc.Action = cc.Class.extend(/** @lends cc.Action# */{
5858 * @return {object }
5959 */
6060 copy :function ( ) {
61+ cc . log ( "copy is deprecated. Please use clone instead." ) ;
6162 return this . clone ( ) ;
6263 } ,
6364
@@ -509,37 +510,38 @@ cc.Follow = cc.Action.extend(/** @lends cc.Follow# */{
509510 if ( ! followedNode )
510511 throw "cc.Follow.initWithAction(): followedNode must be non nil" ;
511512
513+ var _this = this ;
512514 rect = rect || cc . rect ( 0 , 0 , 0 , 0 ) ;
513- this . _followedNode = followedNode ;
514- this . _worldRect = rect ;
515+ _this . _followedNode = followedNode ;
516+ _this . _worldRect = rect ;
515517
516- this . _boundarySet = ! cc . _rectEqualToZero ( rect ) ;
518+ _this . _boundarySet = ! cc . _rectEqualToZero ( rect ) ;
517519
518- this . _boundaryFullyCovered = false ;
520+ _this . _boundaryFullyCovered = false ;
519521
520522 var winSize = cc . director . getWinSize ( ) ;
521- this . _fullScreenSize = cc . p ( winSize . width , winSize . height ) ;
522- this . _halfScreenSize = cc . pMult ( this . _fullScreenSize , 0.5 ) ;
523+ _this . _fullScreenSize = cc . p ( winSize . width , winSize . height ) ;
524+ _this . _halfScreenSize = cc . pMult ( _this . _fullScreenSize , 0.5 ) ;
523525
524- if ( this . _boundarySet ) {
525- this . leftBoundary = - ( ( rect . x + rect . width ) - this . _fullScreenSize . x ) ;
526- this . rightBoundary = - rect . x ;
527- this . topBoundary = - rect . y ;
528- this . bottomBoundary = - ( ( rect . y + rect . height ) - this . _fullScreenSize . y ) ;
526+ if ( _this . _boundarySet ) {
527+ _this . leftBoundary = - ( ( rect . x + rect . width ) - _this . _fullScreenSize . x ) ;
528+ _this . rightBoundary = - rect . x ;
529+ _this . topBoundary = - rect . y ;
530+ _this . bottomBoundary = - ( ( rect . y + rect . height ) - _this . _fullScreenSize . y ) ;
529531
530- if ( this . rightBoundary < this . leftBoundary ) {
532+ if ( _this . rightBoundary < _this . leftBoundary ) {
531533 // screen width is larger than world's boundary width
532534 //set both in the middle of the world
533- this . rightBoundary = this . leftBoundary = ( this . leftBoundary + this . rightBoundary ) / 2 ;
535+ _this . rightBoundary = _this . leftBoundary = ( _this . leftBoundary + _this . rightBoundary ) / 2 ;
534536 }
535- if ( this . topBoundary < this . bottomBoundary ) {
537+ if ( _this . topBoundary < _this . bottomBoundary ) {
536538 // screen width is larger than world's boundary width
537539 //set both in the middle of the world
538- this . topBoundary = this . bottomBoundary = ( this . topBoundary + this . bottomBoundary ) / 2 ;
540+ _this . topBoundary = _this . bottomBoundary = ( _this . topBoundary + _this . bottomBoundary ) / 2 ;
539541 }
540542
541- if ( ( this . topBoundary == this . bottomBoundary ) && ( this . leftBoundary == this . rightBoundary ) )
542- this . _boundaryFullyCovered = true ;
543+ if ( ( _this . topBoundary == _this . bottomBoundary ) && ( _this . leftBoundary == _this . rightBoundary ) )
544+ _this . _boundaryFullyCovered = true ;
543545 }
544546 return true ;
545547 } ,
0 commit comments