File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 124
124
this . rect ( x , y , w , h ) ;
125
125
}
126
126
if ( align === 'right' ) {
127
- if ( txt instanceof Array ) {
128
- for ( var i = 0 ; i < txt . length ; i ++ ) {
129
- var currentLine = txt [ i ] ;
130
- var textSize = this . getStringUnitWidth ( currentLine ) * this . internal . getFontSize ( ) ;
131
- this . text ( currentLine , x + w - textSize - padding , y + this . internal . getLineHeight ( ) * ( i + 1 ) ) ;
132
- }
127
+ if ( ! ( txt instanceof Array ) ) {
128
+ txt = [ txt ] ;
129
+ }
130
+ for ( var i = 0 ; i < txt . length ; i ++ ) {
131
+ var currentLine = txt [ i ] ;
132
+ var textSize = this . getStringUnitWidth ( currentLine ) * this . internal . getFontSize ( ) ;
133
+ this . text ( currentLine , x + w - textSize - padding , y + this . internal . getLineHeight ( ) * ( i + 1 ) ) ;
133
134
}
134
135
} else {
135
136
this . text ( txt , x + padding , y + this . internal . getLineHeight ( ) ) ;
You can’t perform that action at this time.
0 commit comments