-
Notifications
You must be signed in to change notification settings - Fork 186
Remove zoom parameter from CoordinateSystemMapper#mapMonitorBounds() #2742
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
Conversation
Test Results 118 files ±0 118 suites ±0 19m 1s ⏱️ +47s Results for commit 1477a7c. ± Comparison against base commit 4bd22c3. This pull request skips 1 test.♻️ This comment has been updated with latest results. |
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.
In general, the change looks good to me. Could we add some tests to CoordinateSystemMapperTests that document and ensure the expected behavior for the two mappers? The snippets seems to be a good starting point for that.
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/CoordinateSystemMapper.java
Outdated
Show resolved
Hide resolved
e9cf5b5 to
2b71d14
Compare
I have added the test. Need to be reviewed. |
fa68643 to
54fbe7b
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.
The change is sound. Not taking the actual monitor zoom into account when using a single zoom coordinate system is the behavior we used to have for years. I did not find any issues when testing an SDK with disabled monitor-specific scaling.
I have adapted the added test as it previously tested the behavior of mapMonitorBounds based on monitors that were already initialized via mapMonitorBounds, such that potential regresison may be hidden by test setup and assertion logic applying the same error analogously.
bac0167 to
ec4b87a
Compare
ec4b87a to
501169a
Compare
The CoordinateSystemMapper#mapMonitorBounds() method currently accepts a zoom value and that is wrong for SingleZoomCoordinateMapper since it should always use the global zoom (DPIUtil#getDeviceZoom()) instead of monitor zoom. This commit changes how zoom is passed through Rectangle with monitor for MultiZoomCoordinateMapper while that monitor will be ignored for SingleZoomCoordinateMapper.
501169a to
1477a7c
Compare
The CoordinateSystemMapper#mapMonitorBounds() method currently accepts a zoom value and that is wrong for SingleZoomCoordinateMapper since it should always use the global zoom (DPIUtil#getDeviceZoom()) instead of monitor zoom. This commit changes how zoom is passed through Rectangle with monitor for MultiZoomCoordinateMapper while that monitor will be ignored for SingleZoomCoordinateMapper.
How to Test
Results
Before

At 250%
at 150%

Notice that zoom is adapted of monitor even though monitor-specific scaling is turned off.
After

At 250% (Primary)
At 150% (Secondary)

Therefore the size remain same (which is correct behaviour)