File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -629,7 +629,9 @@ cc.LabelBMFont = cc.SpriteBatchNode.extend(/** @lends cc.LabelBMFont# */{
629629 start_line = false ;
630630 startOfWord = - 1 ;
631631 startOfLine = - 1 ;
632- i += justSkipped ;
632+ //i+= justSkipped;
633+ j -- ;
634+ skip -= justSkipped ;
633635 line ++ ;
634636
635637 if ( i >= stringLength )
@@ -733,6 +735,11 @@ cc.LabelBMFont = cc.SpriteBatchNode.extend(/** @lends cc.LabelBMFont# */{
733735 if ( self . _string [ ctr ] . charCodeAt ( 0 ) == 10 || self . _string [ ctr ] . charCodeAt ( 0 ) == 0 ) {
734736 var lineWidth = 0 ;
735737 var line_length = last_line . length ;
738+ // if last line is empty we must just increase lineNumber and work with next line
739+ if ( line_length == 0 ) {
740+ lineNumber ++ ;
741+ continue ;
742+ }
736743 var index = i + line_length - 1 + lineNumber ;
737744 if ( index < 0 ) continue ;
738745
@@ -918,11 +925,11 @@ cc.LabelBMFont = cc.SpriteBatchNode.extend(/** @lends cc.LabelBMFont# */{
918925 } ,
919926
920927 _getLetterPosXLeft :function ( sp ) {
921- return sp . getPositionX ( ) * this . _scaleX + ( sp . _getWidth ( ) * this . _scaleX * sp . _getAnchorX ( ) ) ;
928+ return sp . getPositionX ( ) * this . _scaleX - ( sp . _getWidth ( ) * this . _scaleX * sp . _getAnchorX ( ) ) ;
922929 } ,
923930
924931 _getLetterPosXRight :function ( sp ) {
925- return sp . getPositionX ( ) * this . _scaleX - ( sp . _getWidth ( ) * this . _scaleX * sp . _getAnchorX ( ) ) ;
932+ return sp . getPositionX ( ) * this . _scaleX + ( sp . _getWidth ( ) * this . _scaleX * sp . _getAnchorX ( ) ) ;
926933 }
927934} ) ;
928935
You can’t perform that action at this time.
0 commit comments