fix: clear canvas before filling to support transparent backgrounds#116
Open
slang25 wants to merge 2 commits intocoder:mainfrom
Open
fix: clear canvas before filling to support transparent backgrounds#116slang25 wants to merge 2 commits intocoder:mainfrom
slang25 wants to merge 2 commits intocoder:mainfrom
Conversation
When using a transparent background color, fillRect composites rather than replaces pixels. Add clearRect before fillRect in renderLine, clear, and renderScrollbar to properly erase previous content before applying the background color. This fixes content piling up when using transparent backgrounds and ensures selection highlighting clears properly. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
Problem
When setting the terminal background to a translucent or transparent background, the canvas writing approach ends up stacking up stale content. This PR fixes that.
My first draft actually looked at the background color to decide if it was opaque and then skipped the
clearRectfor that scenario, however I don't think there is a perf hit here so have gone for the more simple approach, if you'd prefer this other approach then please let me know 🙂Summary
clearRectbeforefillRectin canvas rendering methods to properly clear previous contentTest plan
rgba(0,0,0,0))🤖 Generated with Claude Code