Skip to content

Commit

Permalink
fixed: gizmos visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
kleber-swf committed Dec 10, 2021
1 parent 02d1b4d commit 149e633
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
10 changes: 9 additions & 1 deletion src/scene-view/selection-area/gizmos/selection-gizmo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,21 @@

phred-selection-gizmo {
position: absolute;
display: none;
display: block;
padding: 0;
margin: 0;
background-color: transparent;
padding: 0;
margin: 0;

&.invisible {
display: none;
}

&.disabled {
display: none;
}

div {
box-sizing: content-box;
position: absolute;
Expand Down
6 changes: 5 additions & 1 deletion src/scene-view/selection-area/gizmos/selection-gizmo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ export class SelectionGizmo extends HTMLElement implements Gizmo {
private _pointCache2: Point = { x: 0, y: 0 };

public set visible(value: boolean) {
this.style.display = value && Editor.data.selectedObject ? 'block' : 'none';
this.classList.addOrRemove('invisible', !value);
}

public set enabled(value: boolean) {
this.classList.addOrRemove('disabled', !value);
}

public set showGuides(value: boolean) {
Expand Down
2 changes: 1 addition & 1 deletion src/scene-view/selection-area/selection-area.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export class SelectionArea extends HTMLElement {
private onPreferencesChanged(key: PreferenceKey, value: any) {
switch (key) {
case 'gizmos':
this.gizmo.visible = value;
this.gizmo.enabled = value;
return;
case 'snap':
(this.handlers[GIZMO_MOVE] as MoveHandler)
Expand Down

0 comments on commit 149e633

Please sign in to comment.