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

Refresh LineNumberRulerColumn on ZoomChange of canvas #2475

Conversation

akoch-yatta
Copy link
Contributor

This PR adds a listener for the ZoomChanged event to the canvas of a LineNumberRulerColumn. If the listener is notified of this event this means, that state, that differs over different zoom values, must be recalculated. Therefore the indentation are reset, when the event occurs. Problem and solution is similar to #2141 for ImageBasedFrage

How to test

The event is currently thrown for wrapped controls only in win32 with "swt.autoScale.updateOnRuntime"-flag set to true. For the other OS the event will not be thrown for this control in any case to my knowledge.

You need a multi zoom setup, e.g. two monitors with 200% and 100% zoom. If you e.g. open a JavaEditor with line number on the 200% monitor and move that editor over to the 100% monitor, you should see something like the following
Screenshot 2024-10-31 141206

Copy link
Contributor

github-actions bot commented Oct 31, 2024

Test Results

 1 821 files  ±0   1 821 suites  ±0   1h 54m 38s ⏱️ - 5m 30s
 7 724 tests ±0   7 496 ✅ +1  228 💤 ±0  0 ❌  - 1 
24 333 runs  ±0  23 586 ✅ +1  747 💤 ±0  0 ❌  - 1 

Results for commit 6496eea. ± Comparison against base commit 9308f4a.

♻️ This comment has been updated with latest results.

This commit adds a listener for the ZoomChanged event to the canvas of a LineNumberRulerColumn. If the listener is notified of this event this means, that state, that differs over different zoom values, must be recalculated. Therefore the indentation are reset, when the event occurs.

Contributes to eclipse-platform/eclipse.platform.swt#62 and eclipse-platform/eclipse.platform.swt#131
@akoch-yatta akoch-yatta force-pushed the refresh-linenumberruler-on-zoomchange branch from cd00335 to 6496eea Compare November 1, 2024 07:44
@HeikoKlare
Copy link
Contributor

Reproducible with:

  • Primary monitor 200%, secondary monitor 150%
  • Move with open editor from primary to secondary monitor

Before change:
image

After change:
{BA980F95-34F4-40B8-A3A2-FD34E3009076}

@HeikoKlare HeikoKlare merged commit 1170414 into eclipse-platform:master Nov 1, 2024
17 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.

Cut off Line number in multi zoom environments
2 participants