Skip to content

Commit

Permalink
Do not show the transform if there is no current selection
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Nov 29, 2024
1 parent 8485813 commit ef4e8cb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/base/src/3dview/mainview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1524,6 +1524,11 @@ export class MainView extends React.Component<IProps, IStates> {
this.setState(
old => ({ ...old, transform: transformEnabled }),
() => {
// It's a no-op if we try to enable the transform but there is no selection
if (transformEnabled && Object.keys(this._currentSelection || {}).length === 0) {
return;
}

this._transformControls.visible = transformEnabled;
this._transformControls.enabled = transformEnabled;
}
Expand Down

0 comments on commit ef4e8cb

Please sign in to comment.