Skip to content

Commit

Permalink
fix(AbstractWidgetFactory): Fix view widget model
Browse files Browse the repository at this point in the history
Widgets should not take on the WidgetFactory's model. Instead,
explicitly specify what members we want from the factory object.

This avoids populating widgetModel.classHierarchy with unnecessary classes.
  • Loading branch information
floryst committed Jun 23, 2021
1 parent 9f5e34c commit c64e70b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Sources/Widgets/Core/AbstractWidgetFactory/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,15 @@ function vtkAbstractWidgetFactory(publicAPI, model) {
camera,
} = extractRenderingComponents(renderer);
const widgetModel = {};
const widgetPublicAPI = {
const widgetPublicAPI = {};

macro.obj(widgetPublicAPI, widgetModel);
Object.assign(widgetPublicAPI, {
onWidgetChange: publicAPI.onWidgetChange,
};
Object.assign(widgetModel, model, {
});
Object.assign(widgetModel, {
widgetState: model.widgetState,
manipulator: model.manipulator,
viewType,
renderer,
camera,
Expand Down

0 comments on commit c64e70b

Please sign in to comment.