Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#1188) Rows measure greedy #1338

Merged
merged 1 commit into from Oct 19, 2023

Conversation

nils-a
Copy link
Contributor

@nils-a nils-a commented Oct 19, 2023

fixes #1188

  • I have read the Contribution Guidelines
  • I have commented on the issue above and discussed the intended changes
  • A maintainer has signed off on the changes and the issue was assigned to me
  • All newly added code is adequately covered by tests
  • All existing tests are still running without errors
  • The documentation was modified to reflect the changes OR no documentation changes are required.

Changes

The Rows widget was measuring the required space by using the min of the minimal content width and the mix of the maximal content width:

var measurements = _children.Select(c => c.Measure(options, maxWidth)).ToArray();
if (measurements.Length > 0)
{
return new Measurement(
measurements.Min(c => c.Min),
measurements.Min(c => c.Max));
}

The new calculation is "greedy" by always choosing the max value.

Copy link
Contributor

@patriksvensson patriksvensson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@patriksvensson patriksvensson merged commit 63b940c into spectreconsole:main Oct 19, 2023
6 checks passed
@nils-a nils-a deleted the feature/GH-1188 branch November 26, 2023 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rows sizing is inconsistent
2 participants