Paint the range indicator with alpha instead of a stipple image - #4294
Open
vogella wants to merge 1 commit into
Open
Paint the range indicator with alpha instead of a stipple image#4294vogella wants to merge 1 commit into
vogella wants to merge 1 commit into
Conversation
DefaultRangeIndicator built a 1-bit image with every other pixel set to fake a 50 percent tint. On scaled displays the pattern is drawn in blocks of zoom/100 pixels, so at 200 percent the ruler shows a coarse checkerboard instead of a tint. Fill the range with the indicator colour at half alpha instead, which renders as a smooth tint at every zoom and removes the cached image, its dispose listener and the recreation on resize or colour change.
Contributor
Author
Contributor
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.




The range indicator in the vertical ruler was drawn from a 1-bit image with every other pixel set, a stipple that fakes a 50 percent tint. On scaled displays the pattern is scaled in blocks of zoom/100 pixels, so at 200 percent the ruler shows a coarse checkerboard in the indicator colour instead of a tint.
The range is now filled with the indicator colour at half alpha, which renders as a smooth tint at every zoom level and keeps the solid one pixel lines at the top and bottom of the range. The cached image, its dispose listener and the recreation on resize or colour change go away with it, so the class shrinks from 176 to 91 lines.