Fixed issue #1091: Bands disappear with explorer theme - #1383
Open
TetzkatLipHoka wants to merge 1 commit into
Open
Fixed issue #1091: Bands disappear with explorer theme#1383TetzkatLipHoka wants to merge 1 commit into
TetzkatLipHoka wants to merge 1 commit into
Conversation
With the explorer theme active, DetermineLineImageAndSelectLevel() suppresses the tree line under the expand button by overwriting the last line image entry with ltNone. The band conversion in PaintTreeLines() however relies on the documented invariant that ltNone never appears as the last entry: on ltNone it takes over the style of the entry to the right, which for the last entry is an out-of-bounds read of the dynamic array (raises ERangeError with range checking on). The resulting garbage styles made the bands of every collapsed node with children disappear, while expanded nodes stayed intact - matching the screenshot in the issue. Skip the suppression in band mode: bands are box edges, not lines pointing at a button, so there is nothing to suppress. Measured offscreen via pixel counting (see new regression test): identical band rendering with and without the explorer theme state after the fix; before, 53 of 1954 band pixels were missing in the test scenario. Test suite: 2 pre-existing failures (TestCopyHTML1/2, also failing on unmodified master), no new failures. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Fixes #1091.
Cause
With the explorer theme active,
DetermineLineImageAndSelectLevel()suppresses the tree line under the expand button by overwriting the last line image entry withltNone.The band conversion in
PaintTreeLines()however relies on its documented invariant thatltNonenever appears as the last entry ("A no line entry can never appear as last entry so I don't need an end check here"): onltNoneit takes over the style of the entry to the right, which for the last entry is an out-of-bounds read of the dynamic array — with range checking enabled this raisesERangeError.The resulting garbage styles made the bands of every collapsed node with children disappear, while expanded nodes stayed intact (they take the
vsExpandedbranch of the conversion) — matching the screenshot in the issue. Without a themed application manifest the bug does not reproduce, which is why it is easy to miss in test programs.Fix
Skip the suppression when
LineMode = lmBands: bands are box edges, not lines pointing at a button, so there is nothing to suppress. One condition, no behavior change forlmNormal.Verification
Tests/VTBandsIssue1091Tests.pasrenders offscreen and compares band pixels (count plus position checksum) with and without thetsUseExplorerThemestate, following the pattern of the existing paint tests. Without the fix it fails (53 of 1954 band pixels missing in the test scenario), with the fix it passes.TestCopyHTMLfailures also occur on unmodified master).🤖 Generated with Claude Code