Remember Axis Scaling factors and raise their cap - #273
Merged
Merged
Conversation
Addresses the aspect-ratio item of AMReX-Codes#270. The factors are saved when Apply/OK/Reset changes them and restored at startup, and opening a dataset or sequence no longer resets them. Each factor now reaches 10000 (was 100), and the dialog shows factors in shortest form ("1", "1000"; "1e3" works). Spherical plotfiles, where Axis Scaling is unavailable, keep unit factors, and only a change writes the factors, so another window's unrelated save cannot put back its own. The companion's own perpendicular factor stays per companion. Adds qt_axis_scale_settings_smoke.
A number past the box's range was accepted while typing and then, on Enter or focus-out, silently replaced by the previous value. fixup() now clamps it to the nearest bound and shows it (1e19 in Axis Scaling becomes 10000). An overflow counts as past the maximum.
A complete number too small for a double (1e-400) failed to parse and was still silently reverted. It now counts as zero and is clamped to the minimum; unfinished text such as "1e" still keeps the previous value.
fixup() wrote the clamped value in the display format, and the text is parsed again: %.3g turned DBL_MAX into 1.8e+308, an overflow, and could round any bound past itself, so Qt still reverted. It now writes full precision; the committed value is shown in the display format as before.
The C locale used for the full-precision text had RejectGroupSeparator in place of its default OmitGroupSeparator, so 10000 came out as "10,000", which a comma-decimal locale then read as 10. QString::number never groups digits.
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.
Addresses the aspect-ratio item of #270. The factors are saved when Apply/OK/Reset changes them and restored at startup, and opening a dataset or sequence no longer resets them. Each factor now reaches 10000 (was 100), and the dialog shows factors in shortest form ("1", "1000"; "1e3" works). Spherical plotfiles, where Axis Scaling is unavailable, keep unit factors, and only a change writes the factors, so another window's unrelated save cannot put back its own. The companion's own perpendicular factor stays per companion.
Adds qt_axis_scale_settings_smoke.