-
Notifications
You must be signed in to change notification settings - Fork 231
Use OfFloat Point values to create precise highlight brackets #3597
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
base: master
Are you sure you want to change the base?
Conversation
6908099 to
acf0661
Compare
acf0661 to
c558d0a
Compare
c558d0a to
1dd4459
Compare
1dd4459 to
5204db3
Compare
5204db3 to
4e76057
Compare
bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/source/MatchingCharacterPainter.java
Show resolved
Hide resolved
59f94d1 to
a309909
Compare
HeikoKlare
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
So if I understand correctly, we have two issues with two solutions here:
If propose to make two separate PRs, one for each of the issues, out of this. While the usage of |
8afe6f6 to
d0b4a1c
Compare
This PR now keep the height as it was before. The other PR that increases the height is here: #3653 |
bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/source/MatchingCharacterPainter.java
Outdated
Show resolved
Hide resolved
f051eb2 to
76ea734
Compare
bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/source/MatchingCharacterPainter.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/source/MatchingCharacterPainter.java
Outdated
Show resolved
Hide resolved
fffca6a to
873ebaa
Compare
Reason for change request was resolved
|
Can this be merged? @HeikoKlare you did removed your stale review, does that mean you approve the change? |
I will have a look at it today, so hopefully, yes |
akoch-yatta
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't merge this one today. While it fixes some scenarios it break other scenarios now, e.g. overlapping the line in the bottom in some scenarios. We will revise if we can sync the highlight bracket calculation better with the line bounds calculation in StyledText overall.
Because of rounding errors the bracket selection highlight is often inconsistent. Making use of residual values provides precise rectangle values and highlight is consistent across all zooms
873ebaa to
082285f
Compare
|
@akoch-yatta with the latest commit, I got rid of textWidget.getBoundsAtOffset() and use getLocationAtOffset instead since we only need location from styledText and the latter gives us the location without text mining (more accurate). Then we have inconsistency in width and height if you move across different lines of code, for that I use Rectangle.of to so it uses the point OfFloat values and round them accordingly to give us consistent results. I used this code to test the outline on brackets on different lines: and printed out results between master and after my latest changes here. The results are as follow at 175%: Master: After Changes: drawRectangleInPixels: x=110 y=866 width=13 height=27 |
Because of rounding errors the bracket selection highlight is often inconsistent. Making use of residual values provides precise rectangle values and highlight is consistent across all zooms
Problem: At 250% (the problem is also there for all zooms, at 250 its just better visible), After every three line the fourth line x axis is bit too much on the left. (rounding error)
line 29: the width of highlight is 17px
line 30: the width of highlight is 16px
How to test
Result
Before Fix:

After Fix:

Requires: