Skip to content

Commit 21037fc

Browse files
committed
fix(datasetattributes): Fix active attribute assignment
This change fixes an issue where setting different attributes after initializing the dataset causes the active attributes to be retained from previous dataset state.
1 parent 685af96 commit 21037fc

File tree

1 file changed

+1
-9
lines changed
  • Sources/Common/DataModel/DataSetAttributes

1 file changed

+1
-9
lines changed

Sources/Common/DataModel/DataSetAttributes/index.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,9 @@ function vtkDataSetAttributes(publicAPI, model) {
6161
);
6262
return -1;
6363
}
64-
let currentAttribute = model[`active${attType}`];
65-
if (currentAttribute >= 0 && currentAttribute < model.arrays.length) {
66-
if (model.arrays[currentAttribute] === arr) {
67-
return currentAttribute;
68-
}
69-
// FIXME setting an array actually changes its index
70-
publicAPI.removeArrayByIndex(currentAttribute);
71-
}
7264

7365
if (arr) {
74-
currentAttribute = publicAPI.addArray(arr);
66+
const currentAttribute = publicAPI.addArray(arr);
7567
model[`active${attType}`] = currentAttribute;
7668
} else {
7769
model[`active${attType}`] = -1;

0 commit comments

Comments
 (0)