File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
Sources/Rendering/Core/ColorTransferFunction Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -389,13 +389,17 @@ function vtkColorTransferFunction(publicAPI, model) {
389
389
// todo
390
390
const idx = publicAPI . getAnnotatedValueIndexInternal ( x ) ;
391
391
if ( idx < 0 || numNodes === 0 ) {
392
- publicAPI . getNanColor ( rgb ) ;
392
+ const nanColor = publicAPI . getNanColorByReference ( ) ;
393
+ rgb [ 0 ] = nanColor [ 0 ] ;
394
+ rgb [ 1 ] = nanColor [ 1 ] ;
395
+ rgb [ 2 ] = nanColor [ 2 ] ;
393
396
} else {
394
397
const nodeVal = [ ] ;
395
398
publicAPI . getNodeValue ( idx % numNodes , nodeVal ) ;
396
- rgb [ 0 ] = nodeVal . r ;
397
- rgb [ 1 ] = nodeVal . g ;
398
- rgb [ 2 ] = nodeVal . b ;
399
+ // nodeVal[0] is the x value. nodeVal[1...3] is rgb.
400
+ rgb [ 0 ] = nodeVal [ 1 ] ;
401
+ rgb [ 1 ] = nodeVal [ 2 ] ;
402
+ rgb [ 2 ] = nodeVal [ 3 ] ;
399
403
}
400
404
return ;
401
405
}
@@ -1030,7 +1034,10 @@ function vtkColorTransferFunction(publicAPI, model) {
1030
1034
rgba [ 3 ] = 1.0 ; // NodeColor is RGB-only.
1031
1035
return ;
1032
1036
}
1033
- publicAPI . getNanColor ( rgba ) ;
1037
+ const nanColor = publicAPI . getNanColorByReference ( ) ;
1038
+ rgba [ 0 ] = nanColor [ 0 ] ;
1039
+ rgba [ 1 ] = nanColor [ 1 ] ;
1040
+ rgba [ 2 ] = nanColor [ 2 ] ;
1034
1041
rgba [ 3 ] = 1.0 ; // NanColor is RGB-only.
1035
1042
} ;
1036
1043
You can’t perform that action at this time.
0 commit comments