{{ message }}
Make cursor text precision actually correspond to pointing precision. - #16776
Merged
Merged
Conversation
anntzer
force-pushed
the
cursor-significant-digits
branch
from
March 14, 2020 23:01
9c4d240 to
0dc2bfe
Compare
Member
Member
|
Can't we use a simple appoximate solution like |
anntzer
force-pushed
the
cursor-significant-digits
branch
from
March 16, 2020 11:52
0dc2bfe to
ebf2282
Compare
Contributor
Author
|
I slightly optimized the code, and added tim's rough (though likely reasonable :-)) estimate for cases other than x/y. Looks like this PR makes format_data_short ~50x slower than before, but we're still at a reasonable ~100µs per call (so 10^4 calls per second). This should be compared to mouse polling rates (as that's what determines of often this function gets called), which a quick googling suggests is around 100Hz (up to 1kHz for gaming mouses), and screen refresh rates (typically 60Hz). |
6 tasks
anntzer
force-pushed
the
cursor-significant-digits
branch
from
March 16, 2020 15:21
ebf2282 to
2b4d611
Compare
tacaswell
approved these changes
Mar 16, 2020
Contributor
Author
Currently, the cursor text (x=..., y=...) is typically displayed with much, much more precision than the mouse cursor has (typically, one pixel); IOW the last digits displayed are typically meaningless. Make ScalarFormatter.format_data_short convert the inter-pixel distance to data space and compute the corresponding number of significant digits to use (and don't drop the final zeroes if any, as they are now, well, significant). (A similar change could be applied to other formatters, e.g. LogFormatter.)
anntzer
force-pushed
the
cursor-significant-digits
branch
from
March 17, 2020 12:05
2b4d611 to
bfb9cc7
Compare
6 tasks
timhoffm
approved these changes
Apr 11, 2020
7 tasks
7 tasks
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.

Currently, the cursor text (x=..., y=...) is typically displayed with
much, much more precision than the mouse cursor has (typically, one
pixel); IOW the last digits displayed are typically meaningless.
Make ScalarFormatter.format_data_short convert the inter-pixel distance
to data space and compute the corresponding number of significant digits
to use (and don't drop the final zeroes if any, as they are now, well,
significant).
(A similar change could be applied to other formatters, e.g.
LogFormatter.)
PR Summary
PR Checklist