@@ -328,7 +328,7 @@ function vtkVectorText(publicAPI, model) {
328
328
let letterIndex = 0 ;
329
329
model . shapes . forEach ( ( shape ) => {
330
330
let color = null ;
331
- if ( typeof model . perLetterFaceColors === 'function' ) {
331
+ if ( model . perLetterFaceColors ) {
332
332
color = model . perLetterFaceColors ( letterIndex ) || [ 1 , 1 , 1 ] ;
333
333
}
334
334
addShape ( shape , offsetSize , color ) ;
@@ -356,12 +356,12 @@ function vtkVectorText(publicAPI, model) {
356
356
polyData . setPolys ( cells ) ;
357
357
358
358
// Set points (vertices)
359
- polyData . getPoints ( ) . setData ( new Float32Array ( model . verticesArray ) , 3 ) ;
359
+ polyData . getPoints ( ) . setData ( Float32Array . from ( model . verticesArray ) , 3 ) ;
360
360
361
361
// Set texture coordinates
362
362
const da = vtkDataArray . newInstance ( {
363
363
numberOfComponents : 2 ,
364
- values : new Float32Array ( model . uvArray ) ,
364
+ values : Float32Array . from ( model . uvArray ) ,
365
365
name : 'TEXCOORD_0' ,
366
366
} ) ;
367
367
pointData . addArray ( da ) ;
@@ -371,7 +371,7 @@ function vtkVectorText(publicAPI, model) {
371
371
if ( model . colorArray && model . colorArray . length ) {
372
372
const ca = vtkDataArray . newInstance ( {
373
373
numberOfComponents : 3 ,
374
- values : new Float32Array ( model . colorArray ) ,
374
+ values : Uint8Array . from ( model . colorArray ) ,
375
375
name : 'Colors' ,
376
376
} ) ;
377
377
pointData . addArray ( ca ) ;
0 commit comments