-
Notifications
You must be signed in to change notification settings - Fork 187
Refactored CoordinateSystemMapper and added tests #1699
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
Refactored CoordinateSystemMapper and added tests #1699
Conversation
de2fb6d to
ff77ecb
Compare
ff77ecb to
25c81c3
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.
Thank you for adding tests for the mapping calculations in Display and refactoring to the code accordingly.
In order to have the refactoring integrated as soon as possible (i.e., to have this PR finalized and merged), I have two questions @amartya4256:
- Since the
MultiZoomCoordinateSystemMapperis still under development (and as long as that's the case some tests will probably always be failing), can we deactivate those test for now? - Can we parameterize (or copy and adapt) the tests to also be applied to the
SingleZoomCoordinateSystemMapper? Having regression tests for the existing HiDPI behavior and the mapping of coordinates in it would be great as well.
5a4099e to
8de8aa6
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.
Thank you for the adaptations. Would it be possible to reuse / parameterize the tests for SingleZoomCoordinateSystemMapper (see #1699 (review))?
I have some further comments and please add a copyright header to the three new classes.
...es/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/SingleZoomCoordinateMapper.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/CoordinateSystemMapper.java
Outdated
Show resolved
Hide resolved
...eclipse.swt/Eclipse SWT Tests/win32/org/eclipse/swt/widgets/CoordinateSystemMapperTests.java
Outdated
Show resolved
Hide resolved
13df60f to
83c3ee7
Compare
I can adjust the tests to support that. The monitors need to be created differently because right now the monitors are created with the offset values for multi monitor. But other than that, it should be fine except for some tests specific to Gap which will not be valid for it. |
If that can be added really quickly, it would be a great win for regression testing. But if not, we should just leave it as is, since changes to the existing coordinate system mapper will be rather seldom (and we could also extend the test cases once changes need to be performed). |
404e1af to
ab28cd8
Compare
This commit refactors the Display to separate single zoom and multi zoom coordinate system mappers in separate classes. Additionally, it adds some tests for validating the multi-zoom coordinate system mapper. A few tests are disabled because of the current state of multi-zoom coordinate system limitations. Contributes to eclipse-platform#62 and eclipse-platform#127
ab28cd8 to
7403c74
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.
Thank you for the latest update, including the extension of the tests to the single-zoom coordinate system mapper.
It looks fine to me now. I have just rebased on master and applied some formatting as indentations in the test class were broken.
No description provided.