| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
👍 in principle, but this is in the hot-loop of user feedback, are we sure that this won't be slow? |
Sorry, something went wrong.
|
Can't we use a simple appoximate solution like digits = abs(log10((xmax - xmin) / NUM_PIXELS)) with an upper estimate of NUM_PIXELS=1e4 (details to be tuned). |
Sorry, something went wrong.
|
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). |
Sorry, something went wrong.
|
added whatsnew |
Sorry, something went wrong.
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.)
| Back | FazBrowse Home | New Git URL |
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