@@ -183,13 +183,25 @@ describe('text', function () {
183
183
} ) ;
184
184
} ) ;
185
185
186
- test ( 'ignore trailing line break - issue #1620' , function ( ) {
187
- return runDocTest ( { systemFonts : true } , function ( doc ) {
186
+ test ( 'ignore trailing line break - issue #1620' , function ( ) {
187
+ return runDocTest ( { systemFonts : true } , function ( doc ) {
188
188
const text = 'test\ntest' ;
189
- let heightWithout = doc . heightOfString ( text , { trailingLineBreak : false } ) ;
190
- doc . save ( ) . rect ( doc . x , doc . y , doc . page . contentWidth , heightWithout ) . strokeColor ( "red" , 0.3 ) . stroke ( ) . restore ( ) ;
189
+ let heightWithout = doc . heightOfString ( text , {
190
+ trailingLineBreak : false ,
191
+ } ) ;
192
+ doc
193
+ . save ( )
194
+ . rect ( doc . x , doc . y , doc . page . contentWidth , heightWithout )
195
+ . strokeColor ( 'red' , 0.3 )
196
+ . stroke ( )
197
+ . restore ( ) ;
191
198
let height = doc . heightOfString ( text ) ;
192
- doc . save ( ) . rect ( doc . x , doc . y , doc . page . contentWidth , height ) . strokeColor ( "blue" , 0.3 ) . stroke ( ) . restore ( ) ;
199
+ doc
200
+ . save ( )
201
+ . rect ( doc . x , doc . y , doc . page . contentWidth , height )
202
+ . strokeColor ( 'blue' , 0.3 )
203
+ . stroke ( )
204
+ . restore ( ) ;
193
205
doc . text ( text , { height } ) ;
194
206
} ) ;
195
207
} ) ;
0 commit comments