Skip to content

Commit

Permalink
Merge pull request #2476 from tomsuchel/add-reset-function-to-linewidget
Browse files Browse the repository at this point in the history
feat(linewidget): add reset function to LineWidget
  • Loading branch information
finetjul authored Jun 22, 2022
2 parents 9f2ec70 + 99c75e5 commit 671c450
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Sources/Widgets/Widgets3D/LineWidget/behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,4 +391,17 @@ export default function widgetBehavior(publicAPI, model) {
model._widgetManager.enablePicking();
model._interactor.render();
};

publicAPI.reset = () => {
model.widgetState.deactivate();
model.widgetState.getMoveHandle().deactivate();

model.widgetState.getHandle1().setOrigin(null);
model.widgetState.getHandle2().setOrigin(null);
model.widgetState.getMoveHandle().setOrigin(null);
model.widgetState.getText().setOrigin(null);
model.widgetState.getText().setText('');

model.activeState = null;
};
}

0 comments on commit 671c450

Please sign in to comment.