@@ -276,26 +276,26 @@ Object.assign(pc, function () {
276
276
var ti = i % this . _font . textures [ 0 ] . length ;
277
277
var p = ( i - ti ) / this . _font . textures [ 0 ] . length ;
278
278
279
+ if ( ! this . _meshInfo [ i ] ) {
280
+ this . _meshInfo [ i ] = new MeshInfo ( ) ;
281
+ }
282
+
279
283
if ( multiPassNeeded ) {
280
284
this . _meshInfo [ i ] . renderPass = passes [ p ] ;
281
285
} else {
282
286
this . _meshInfo [ i ] . renderPass = RenderPass . ALL_IN_ONE ;
283
287
}
284
288
285
- if ( ! this . _meshInfo [ i ] ) {
286
- this . _meshInfo [ i ] = new MeshInfo ( ) ;
287
- } else {
288
- // keep existing entry but set correct parameters to mesh instance
289
- var mi = this . _meshInfo [ i ] . meshInstance ;
290
- if ( mi ) {
291
- mi . setParameter ( "font_sdfIntensity" , this . _font . intensity ) ;
292
- mi . setParameter ( "font_pxrange" , this . _getPxRange ( this . _font ) ) ;
293
- mi . setParameter ( "font_textureWidth" , this . _font . data . info . maps [ ti ] . width ) ;
294
-
295
- mi . setParameter ( "render_pass" , this . _meshInfo [ i ] . renderPass ) ;
296
- this . _setTextureParams ( mi , this . _font . textures [ 0 ] [ ti ] , ( multiPassNeeded ) ? this . _font . textures [ 1 ] [ ti ] : null ) ;
297
- }
289
+ // set correct parameters to mesh instance (if valid)
290
+ var mi = this . _meshInfo [ i ] . meshInstance ;
291
+ if ( mi ) {
292
+ mi . setParameter ( "font_sdfIntensity" , this . _font . intensity ) ;
293
+ mi . setParameter ( "font_pxrange" , this . _getPxRange ( this . _font ) ) ;
294
+ mi . setParameter ( "font_textureWidth" , this . _font . data . info . maps [ ti ] . width ) ;
295
+ mi . setParameter ( "render_pass" , this . _meshInfo [ i ] . renderPass ) ;
296
+ this . _setTextureParams ( mi , this . _font . textures [ 0 ] [ ti ] , ( multiPassNeeded ) ? this . _font . textures [ 1 ] [ ti ] : null ) ;
298
297
}
298
+
299
299
}
300
300
301
301
// destroy any excess mesh instances
0 commit comments