quick dirty implement for a non neutral cursor x/y display#15
Open
chihirobelmo wants to merge 4 commits intodevelopfrom
Open
quick dirty implement for a non neutral cursor x/y display#15chihirobelmo wants to merge 4 commits intodevelopfrom
chihirobelmo wants to merge 4 commits intodevelopfrom
Conversation
arithex
requested changes
Mar 20, 2025
| AxisValueProgress.Foreground = CommonConstants.LIGHTRED; | ||
| check_ABIDLE.Visibility = Visibility.Visible; | ||
| check_ABIDLE.Content = "IDLE CUTOFF"; | ||
| if (Math.Abs(AxisValueProgress.Value) < CommonConstants.AXISMAX * 0.5 - CommonConstants.AXIS_NEUTRAL_TOLERANCE | |
Collaborator
There was a problem hiding this comment.
This compound-if seems needlessly confusing, to me. (Why are we taking Abs of the AxisValueProgress.. can it ever be negative? And what is up with the bitwise-OR vs logical OR..?)
Taking Abs of the distance from center, is what I would normally expect to see..
float axisCenter = CommonConstants.AXISMAX * 0.5;
if (Math.Abs(AxisValueProgress.Value-axisCenter) > CommonConstants.AXIS_NEUTRAL_TOLERANCE) { ...
Collaborator
There was a problem hiding this comment.
Actually what might be better.. is we modify the ApplyDeadZone() function above, to return a bool indicating if the axis in the deadzone or not. (Or maybe a separate method, "IsInDeadZone" or something. Haven't looked closely at it.)
Then, this indicator would be naturally dynamic.. no need for CommonConstants.AXIS_NEUTRAL_TOLERANCE
And it would serve to help people set appropriate deadzone size.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#14