TabView continuous expansions fix #6954
Merged
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.
Description
The Geometry size for the SelectedBackgroundPath would sometimes exceed its container size by a fraction of a pixel causing that container to expand by that fraction. The Geometry would subsequently increase by that small amount again causing an infinite loop of ever increasing sizes.
For horizontal expansions, we decrease the geometry width by 1 / scaleFactor.
For vertical expansions, we decrease the geometry height by 1 / scaleFactor compared to Reverting product change made for 'TabView gap between active tab and active content fix #6644' by RBrid · Pull Request #6936 · microsoft/microsoft-ui-xaml (github.com).
I confirmed both horizontal and vertical expansions are no longer occurring after just swapping the Microsoft.UI.Xaml.dll on the repro'ing machine.
(The horizontal expansion was occurring while using the FitToContent TabWidthMode.)
Since I was in there I also fixed the misnamed previousAvailableSize class field, and since I heavily used TabView debug tracing during this investigation, I am adding the infrastructure for using the convenient TABVIEW_TRACE_INFO type of macros for future debugging.