Avoid stale-positive anchor refresh for vertically stretched right-an…#36
Open
jaywang-cn wants to merge 2 commits into
Open
Avoid stale-positive anchor refresh for vertically stretched right-an…#36jaywang-cn wants to merge 2 commits into
jaywang-cn wants to merge 2 commits into
Conversation
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.
Summary
The issue occurred in a
TabControl > TabPage > GroupBoxlayout where theGroupBoxwas anchored withTop | Bottom | Right. During initialization, the GroupBox slightly exceeded the right edge of its parentTabPageby one pixel. After the parent controls were resized, theGroupBoxunexpectedly kept its original location and size instead of moving with the right edge and stretching vertically.Root Cause
The
DefaultLayout.AnchorLayoutCompatstale-positive anchor repair treated the GroupBox’s small positive right anchor offset as stale layout metadata.In this case, the captured anchor data looked like a stale positive right anchor, but it actually represented a valid right-edge relationship for a control that was also vertically stretched. Because the compat repair refreshed the full AnchorInfo, it also overwrote the vertical stretch anchor information. As a result, the control was laid out back at its original bounds rather than respecting its Right and Top | Bottom anchor behavior.
Fix
The stale-positive right-anchor refresh is now skipped when the control is vertically stretch-anchored, meaning it has both Top and Bottom anchors.
This prevents Top | Bottom | Right controls from being incorrectly classified as stale-positive-anchor cases while preserving the existing stale-positive refresh behavior for non-stretched right-anchored controls.
A regression test was added for the CargoWise layout shape to ensure that a vertically stretched, right-anchored control with a small positive right offset does not trigger the stale-positive refresh path.
CW side:
The issue behaviour: open a declaration in TR company, switch to following tab page, we will see the groupbox is renderred overlap with the grid.


After the changes: