Skip to content

Conversation

@ShahzaibIbrahim
Copy link
Contributor

@ShahzaibIbrahim ShahzaibIbrahim commented Jan 9, 2026

In some zoom level the highlight is too close to the text and cutoff sometimes.

Example:

Here with zoom 125% the bracket selection seems to cut off the text.
image

After increasing the size by 1 pt, we get something like this

image

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
In some zoom level the highlight is too close to the text and cutoff
sometimes.
@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

Test Results

 3 015 files  ±0   3 015 suites  ±0   2h 11m 51s ⏱️ - 4m 6s
 8 258 tests ±0   8 010 ✅ ±0  248 💤 ±0  0 ❌ ±0 
23 598 runs  ±0  22 807 ✅ ±0  791 💤 ±0  0 ❌ ±0 

Results for commit dbb2767. ± Comparison against base commit 93acda3.

@vogella
Copy link
Contributor

vogella commented Jan 11, 2026

LGTM

@vogella
Copy link
Contributor

vogella commented Jan 11, 2026

@HeikoKlare any concerns here?

Copy link
Contributor

@laeubi laeubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the -1 does not make any sense here.


// draw box around line segment
gc.drawRectangle(bounds.x, bounds.y + bounds.height - height, width, height - 1);
gc.drawRectangle(rectangleOfFloat);
Copy link
Contributor

@laeubi laeubi Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need the rectangle of floats here at all? for me the error seems simply to subtract one from the height so a much simpler to remove the -1 from the original code.

gc.drawRectangle(bounds.x, bounds.y + bounds.height - height, width, height);

@HeikoKlare
Copy link
Contributor

This PR misses the mentioned that it is an extract of #3597, which combined two issues:

  • The highlight not properly being scaled on higher zooms (which is the reason for the float-based Rectangle
  • The highlight drawn on top of the bracket, caused by the -1.

While the first change is fine for me, I proposed to extract out the second change (removing the "-1") into a separate PR (see #3597 (comment)), as the "-1" was there to fit the highlight into the line (see screenshot here #3597 (review)). So there seems to habe been a specific reason for the -1 and it might be up for discussion if that should be removed (i. i.e., if the highlight should fit in the line or if highlight should not being drawn over the bottom part of the bracket).

And the PR description actually seems wrong, as the example with the bracket exceeding the highlight at some zooms is about the OfFloat change, which is already covered by that other PR. The screenshot of the result is a combination of the two changes instead of just the single one that is supposed to be done by this PR (putting the "-1" removal on top. @ShahzaibIbrahim can you please update this PR accordingly?

If I am not mistaken, this change on top of https://github.com/eclipse-platform/eclipse.platform.ui/pull/3597/files will just change this appearance:
image
image

with this:
image

image

@ShahzaibIbrahim
Copy link
Contributor Author

Sorry, I failed to mention that this PR depends on #3597 before being review (to avoid conflicts). I will update the screenshots as well.

@ShahzaibIbrahim ShahzaibIbrahim marked this pull request as draft January 12, 2026 08:53
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.

Bracket selection square too small in some zooms

4 participants