-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
The light now goes away when the cursor's visibility is set to false. #839
Conversation
…using SetVisibility.
@@ -153,15 +155,38 @@ public override void SetVisiblity(bool visible) | |||
|
|||
if (visible) | |||
{ | |||
if (Light != null) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
- SetVisibility true/false
- The elements' visibility is set
- 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.
There was a problem hiding this 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.
…ursor The light now goes away when the cursor's visibility is set to false.
Using the cursor SetVisibility, the ring, dot and light is set properly. Issue #785