Skip to content

Avoid stale-positive anchor refresh for vertically stretched right-an…#36

Open
jaywang-cn wants to merge 2 commits into
masterfrom
JWA/TryFixShouldRefreshAnchorInfo
Open

Avoid stale-positive anchor refresh for vertically stretched right-an…#36
jaywang-cn wants to merge 2 commits into
masterfrom
JWA/TryFixShouldRefreshAnchorInfo

Conversation

@jaywang-cn

@jaywang-cn jaywang-cn commented Jul 9, 2026

Copy link
Copy Markdown

Summary

The issue occurred in a TabControl > TabPage > GroupBox layout where the GroupBox was anchored with Top | Bottom | Right. During initialization, the GroupBox slightly exceeded the right edge of its parent TabPage by one pixel. After the parent controls were resized, the GroupBox unexpectedly kept its original location and size instead of moving with the right edge and stretching vertically.

Root Cause

The DefaultLayout.AnchorLayoutCompat stale-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.
image
After the changes:
image

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.

1 participant