Skip to content

Commit

Permalink
fix(outlineThickness): allow 0 thickness per segment index
Browse files Browse the repository at this point in the history
  • Loading branch information
sedghi authored and finetjul committed Apr 29, 2024
1 parent 21534d1 commit 9f853f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Sources/Rendering/OpenGL/ImageMapper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1376,9 +1376,11 @@ function vtkOpenGLImageMapper(publicAPI, model) {
// Assuming labelOutlineThicknessArray contains the thickness for each segment
for (let i = 0; i < lWidth; ++i) {
// Retrieve the thickness value for the current segment index.
// If the value is undefined, null, or 0, use the first element's value as a default.
// If the value is undefined, use the first element's value as a default, otherwise use the value (event if 0)
const thickness =
labelOutlineThicknessArray[i] || labelOutlineThicknessArray[0];
typeof labelOutlineThicknessArray[i] !== 'undefined'
? labelOutlineThicknessArray[i]
: labelOutlineThicknessArray[0];
lTable[i] = thickness;
}
model.labelOutlineThicknessTexture.releaseGraphicsResources(
Expand Down
7 changes: 5 additions & 2 deletions Sources/Rendering/OpenGL/VolumeMapper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1782,9 +1782,12 @@ function vtkOpenGLVolumeMapper(publicAPI, model) {
// Assuming labelOutlineThicknessArray contains the thickness for each segment
for (let i = 0; i < lWidth; ++i) {
// Retrieve the thickness value for the current segment index.
// If the value is undefined, null, or 0, use the first element's value as a default.
// If the value is undefined, use the first element's value as a default, otherwise use the value (event if 0)
const thickness =
labelOutlineThicknessArray[i] || labelOutlineThicknessArray[0];
typeof labelOutlineThicknessArray[i] !== 'undefined'
? labelOutlineThicknessArray[i]
: labelOutlineThicknessArray[0];

lTable[i] = thickness;
}

Expand Down

0 comments on commit 9f853f1

Please sign in to comment.