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 double-rendering of partially-selected tokens, causing visual bolding #559

Merged
merged 3 commits into from
Jul 10, 2024

Conversation

bobbylight
Copy link
Owner

@bobbylight bobbylight commented Jul 7, 2024

This prior PR added ligature support to RSTA, but had a visual issue that was harder to notice on macOS, but is pretty apparent on Windows. Specifically, when kerning or ligatures were enabled, partially-selected tokens could appear slightly bolded due to them effectively being double-rendered. This results in pixels with < 1 alpha to appear darker than they should.

This PR addresses that issue by never rerendering chars on top of themselves after they are rendered once. This does require our rendering logic for selected text to be more complicated (actually, somewhat similar to what it was before ligature support); however I've also taken the opportunity to share more code between SyntaxView and WrappedSyntaxView here, so the pros outweigh the cons :)

Before After
image image

@bobbylight bobbylight changed the title Fix double-rendering of partially-selected tokens, causing visual bol… Fix double-rendering of partially-selected tokens, causing visual bolding Jul 8, 2024
Copy link

codecov bot commented Jul 8, 2024

Codecov Report

Attention: Patch coverage is 83.01887% with 9 lines in your changes missing coverage. Please review.

Project coverage is 74.62%. Comparing base (7055442) to head (09857b2).

Files Patch % Lines
...n/java/org/fife/ui/rsyntaxtextarea/SyntaxView.java 85.71% 4 Missing and 2 partials ⚠️
...va/org/fife/ui/rtextarea/RTextAreaHighlighter.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #559      +/-   ##
============================================
+ Coverage     74.61%   74.62%   +0.01%     
  Complexity     6881     6881              
============================================
  Files           178      178              
  Lines         30267    30264       -3     
  Branches       3919     3912       -7     
============================================
+ Hits          22584    22586       +2     
+ Misses         5860     5857       -3     
+ Partials       1823     1821       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bobbylight bobbylight marked this pull request as ready for review July 10, 2024 23:06
@bobbylight bobbylight self-assigned this Jul 10, 2024
@bobbylight bobbylight added this to the 3.5.0 milestone Jul 10, 2024
@bobbylight bobbylight merged commit 36b928f into master Jul 10, 2024
8 checks passed
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