Skip to content

Commit a863f7c

Browse files
committed
fix(lookuptable): fix refactoring
fix refactoring (put table in defaultValues)
1 parent 6016c23 commit a863f7c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sources/Common/Core/LookupTable/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ function vtkLookupTable(publicAPI, model) {
303303
function defaultValues(initialValues) {
304304
return {
305305
// Internal objects
306+
table: [],
306307
buildTime: macro.obj({}),
307308
opaqueFlagBuildTime: macro.obj({}, { mtime: 0 }),
308309
insertTime: macro.obj({}, { mtime: 0 }),
@@ -337,8 +338,9 @@ export function extend(publicAPI, model, initialValues = {}) {
337338
vtkScalarsToColors.extend(publicAPI, model, initialValues);
338339

339340
// Internal objects initialization
340-
if (!model.table) {
341-
model.table = [];
341+
if (Array.isArray(initialValues.table)) {
342+
model.table = initialValues.table;
343+
delete initialValues.table;
342344
}
343345

344346
// Create get-only macros

0 commit comments

Comments
 (0)