Repository navigation
Fix DonutChart infinite loop with null-valued entries in LeftAndRight label mode - #379
Merged
Merged
Conversation
DrawCaptionLeftAndRight skipped null-valued entries with `continue` without advancing the loop index, so a DonutChart that had any null-valued entry and used the default LeftAndRight label mode would spin forever (app hang). Advance the index before the skip in both the right-side and left-side split loops. Verified with a headless render: a donut with a null-valued entry in the default label mode previously hung (killed after 12s) and now renders. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Summary
DonutChart.DrawCaptionLeftAndRight(the defaultLeftAndRightlabel mode) skipped null-valued entries withcontinuewithout advancing the loop index, so anyDonutChartthat contained a null-valued entry and used the default label mode would spin forever — an app hang. The fix advances the index before the skip in both the right-side and left-side split loops, soialways progresses.Verification
Reproduced and fixed with a headless SkiaSharp render (a donut with a null-valued entry, default
LeftAndRightmode):chart.Draw(...)never returned — killed by a 12s watchdog.Context: the originally-reported issue #124 ("5 labels, last one dropped") turned out to be already fixed; this hang is a separate defect found while investigating it.
🤖 Generated with Claude Code