Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Caret Drawing Artifacts #348

Merged

Conversation

thecoolwinter
Copy link
Contributor

@thecoolwinter thecoolwinter commented Aug 8, 2024

Updates the caret drawing function to clip to it's bounds. Fixes a small visual bug where the unfocused box stuck around in the layer because it was never cleared due to it being outside the view's bounds. Fixes by first clearing the entire layer and then drawing.

Updates the macOS Caret background color when the color is set using the public variable. Fixes an issue where the caret color was not being used on macOS if it was changed after initialization.

Screenshots
Caret drawing is mostly the same, just that it's only drawing inside the bounds of the cell the cursor is in.

Caret drawing without patch, note leftover stroke artifacts from the unfocused box when focused:
Screenshot 2024-08-08 at 10 27 27 AM
Screenshot 2024-08-08 at 10 26 59 AM
Screenshot 2024-08-08 at 10 27 03 AM
Screenshot 2024-08-08 at 10 27 30 AM

Caret drawing with patch:
macOS from CodeEdit
Focused, block
Screenshot 2024-08-08 at 9 59 29 AM
Screenshot 2024-08-08 at 9 59 25 AM
Focused, underline
Screenshot 2024-08-08 at 9 58 43 AM
Screenshot 2024-08-08 at 9 58 40 AM
Focused, bar
Screenshot 2024-08-08 at 9 58 32 AM
Unfocused
Screenshot 2024-08-08 at 9 59 33 AM
Screenshot 2024-08-08 at 9 59 38 AM
iOS from example SSH app
IMG_8129
IMG_8133
IMG_8132
IMG_8131

Update the caret drawing function to clip to it's bounds. Fixes a small visual bug where the unfocused box stuck around in the layer because it was never cleared due to it being outside the view's bounds.
Updates the macOS Caret background color when the color is set using the public variable.

Fixes an issue where the caret color was not being used on macOS if it was changed after initialization.
@migueldeicaza
Copy link
Owner

Thank you for your contribution!

@migueldeicaza migueldeicaza merged commit c0ba497 into migueldeicaza:main Aug 8, 2024
1 check failed
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.

2 participants