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

Multi zoom level support for caret #1294

Conversation

amartya4256
Copy link
Contributor

Addressed issues

Requires

Note: Only the last commit in this PR is to be reviewed. Previous commit(s) belong to the prerequisite PR(s)

Description

This PR allows the caret to scale on a DPI change event on styled text. It uses the line height of the styled text to set on caret. The height and width field in the caret are storing data in points now and not in pixels. We do so to avail the scaling refernece. Also we use SWT.DEFAULT to ignore setting of width. It is useful when we set the new height on DPI change since the preferred width of the caret is loadeed from preferences on the Caret creation.

Contributes to #62 and #127

@amartya4256 amartya4256 requested a review from niraj-modi as a code owner June 21, 2024 11:37
Copy link
Contributor

github-actions bot commented Jun 21, 2024

Test Results

   470 files  ±0     470 suites  ±0   7m 45s ⏱️ +37s
 4 135 tests ±0   4 127 ✅ ±0   8 💤 ±0  0 ❌ ±0 
16 336 runs  ±0  16 244 ✅ ±0  92 💤 ±0  0 ❌ ±0 

Results for commit 29bb0a4. ± Comparison against base commit f25e352.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@fedejeanne fedejeanne left a comment

Choose a reason for hiding this comment

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

Some minor suggestions to improve readability.

Also, please check the whole class and see if you can:

  1. Reduce the visibility of some of the methods with package protected (default) visibility
  2. Rename some other parameters in methods xyzInPixels so they are also called xInPixels / yInPixels etc

@amartya4256 amartya4256 force-pushed the multi_zoom_level_styled_text_caret branch from 0b8ac01 to 6085f29 Compare June 24, 2024 11:12
@amartya4256 amartya4256 force-pushed the multi_zoom_level_styled_text_caret branch 4 times, most recently from 7aff855 to 113a070 Compare June 27, 2024 09:42
Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

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

I have some comments, the most important one about a non-API-conforming change that needs to be addressed (which is submitted as a separate, subsequent comment, as it was not properly submitted with this review).

@amartya4256 amartya4256 force-pushed the multi_zoom_level_styled_text_caret branch 3 times, most recently from f5f201c to 76688cd Compare June 27, 2024 13:43
Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

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

The changes look good now. In particular, I did not find any faulty direct access to x, y, width and height not being replaced by the new value-in-pixel getters.
I have also successfully tested the changes in an SDK product at 100%, 150% and 200%.

I have only minor remarks left.

@HeikoKlare
Copy link
Contributor

@fedejeanne anything left to do from your side?

@amartya4256 amartya4256 force-pushed the multi_zoom_level_styled_text_caret branch from 76688cd to 329a630 Compare June 27, 2024 15:49
This commit scales the caret on a DPI change event on styled text. It
uses the line height of the styled text to set on caret. The
height and width field in the caret are storing data in points now and
not in pixels. We do so to avail the scaling refernece. Also we use
SWT.DEFAULT to ignore setting of width. It is useful when we set the new
height on DPI change since the preferred width of the caret is loadeed
from preferences on the Caret creation.

Contributes to eclipse-platform#62 and eclipse-platform#127
@amartya4256 amartya4256 force-pushed the multi_zoom_level_styled_text_caret branch from 329a630 to 29bb0a4 Compare June 28, 2024 09:27
@fedejeanne fedejeanne merged commit 5cdf331 into eclipse-platform:master Jun 28, 2024
14 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.

3 participants