Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setRange call to vtkDataArray for single component arrays #117

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

jadh4v
Copy link
Contributor

@jadh4v jadh4v commented Jul 26, 2023

Fix setRange call to vtkDataArray for single component arrays.

There may be cases (such as here) where an explicit call is made to vtkDataArray::getRange(range, 0) with index === 0. This can trigger unexpected call to computeRange if setRange isn't called with index === 0 before.

@jadh4v jadh4v changed the base branch from master to beta July 26, 2023 20:50
@jadh4v jadh4v changed the title Fix data array set range Fix setRange call to vtkDataArray for single component arrays Jul 26, 2023
@floryst
Copy link
Collaborator

floryst commented Jul 26, 2023

Oh, I didn't realize you were looking into this from the react-vtk-js side. This was fixed in vtk.js proper: Kitware/vtk-js#2872

src/core/DataArray.ts Outdated Show resolved Hide resolved
For a vtkDataArray of single component, range is cached with
index = 0 and not with index = numberOfComponents = 1
@floryst
Copy link
Collaborator

floryst commented Jul 27, 2023

LGTM!

@floryst floryst merged commit d45d66d into Kitware:beta Jul 27, 2023
@jourdain
Copy link
Collaborator

🎉 This PR is included in version 2.0.0-beta.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants