Scale the glyph-size slider and auto size to the shape's overall size#2599
Open
akenmorris wants to merge 1 commit into
Open
Scale the glyph-size slider and auto size to the shape's overall size#2599akenmorris wants to merge 1 commit into
akenmorris wants to merge 1 commit into
Conversation
…#2459) The glyph-size slider mapped its [1, 100] range to a fixed world-unit range of [0.1, 10], and the auto glyph size was clamped to the same fixed [0.1, 10]. So on abnormally small or large shapes both hit those limits well before reaching a usable size. Scale both to the shape's largest dimension instead: Session exposes get_glyph_size_scale() (the largest X/Y/Z extent), the slider maps to [0.1%, 10%] of it (step = scale / 1000), and the auto size is clamped to the same [0.1%, 10%] range. A shape whose largest dimension is 100 behaves identically to before, with a fallback to that mapping when no shape is loaded. Also round the displayed glyph size to 3 significant figures.
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.
Resolves #2459
The glyph-size slider mapped its [1, 100] range to a fixed world-unit range of [0.1, 10], and the auto glyph size was clamped to the same fixed [0.1, 10]. So on abnormally small or large shapes both hit those limits well before reaching a usable size.
Scale both to the shape's largest dimension instead: Session exposes get_glyph_size_scale() (the largest X/Y/Z extent), the slider maps to [0.1%, 10%] of it (step = scale / 1000), and the auto size is clamped to the same [0.1%, 10%] range. A shape whose largest dimension is 100 behaves identically to before, with a fallback to that mapping when no shape is loaded. Also round the displayed glyph size to 3 significant figures.