Skip to content

Commit

Permalink
fix(CoincidentTopologyHelper): add no op modified function
Browse files Browse the repository at this point in the history
because publicAPI.modifed is called by macros.js object setter macro.

Avoid error calling functions like vtkMapper.setResolveCoincidentTopologyPolygonOffsetParameters
  • Loading branch information
PaulHax authored and floryst committed Oct 8, 2024
1 parent b425c0c commit 4691eea
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Sources/Rendering/Core/Mapper/CoincidentTopologyHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ const staticOffsetModel = {
Line: { factor: 1, offset: -1 },
Point: { factor: 0, offset: -2 },
};
const staticOffsetAPI = {};
const noOp = () => undefined;
const staticOffsetAPI = {
modified: noOp,
};

addCoincidentTopologyMethods(
staticOffsetAPI,
Expand Down Expand Up @@ -58,9 +61,11 @@ function implementCoincidentTopologyMethods(publicAPI, model) {
Object.keys(otherStaticMethods).forEach((methodName) => {
publicAPI[methodName] = otherStaticMethods[methodName];
});
Object.keys(staticOffsetAPI).forEach((methodName) => {
publicAPI[methodName] = staticOffsetAPI[methodName];
});
Object.keys(staticOffsetAPI)
.filter((methodName) => methodName !== 'modified') // don't override instance's modified
.forEach((methodName) => {
publicAPI[methodName] = staticOffsetAPI[methodName];
});

addCoincidentTopologyMethods(
publicAPI,
Expand Down

0 comments on commit 4691eea

Please sign in to comment.