Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The light now goes away when the cursor's visibility is set to false. #839

Merged

Conversation

killerantz
Copy link
Member

Using the cursor SetVisibility, the ring, dot and light is set properly. Issue #785

@@ -153,15 +155,38 @@ public override void SetVisiblity(bool visible)

if (visible)
{
if (Light != null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm finding this a little harder to follow because some state is implemented in this function related to Light, some is updated in OnCursorStateChange, and some is in ElementVisibility. Which one is used depends on whether we're becoming visible or invisible. If I were modifying this code, I think I'd have a hard time convincing myself that I'm doing it correctly for all the possible cases. Would it be possible to simplify this so that all state updates flow through a single path?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good points. I was over thinking it because it feels counter productive to set the visibility one way if I know for sure the visibility will be set back again in the same frame. I removed all the extra checks so the sequence now works like this.

  1. SetVisibility true/false
  2. The elements' visibility is set
  3. If visibility is true, then set the state change which will set the visibility of the ring or dot depending on state.

… in SetVisibility to make things easier to read.
Copy link
Contributor

@ForrestTrepte ForrestTrepte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice reorganization of SetVisiblity.

@StephenHodgson StephenHodgson merged commit 99cb9ee into microsoft:master Aug 9, 2017
keveleigh pushed a commit to keveleigh/HoloToolkit-Unity that referenced this pull request Aug 11, 2017
…ursor

The light now goes away when the cursor's visibility is set to false.
@killerantz killerantz deleted the fix/interactiveMeshCursor branch October 21, 2022 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants