-
Notifications
You must be signed in to change notification settings - Fork 143
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 Support for region for win32 #1278
Multi Zoom Support for region for win32 #1278
Conversation
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 code doesn't compile.
Also, there's a typo.
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Region.java
Outdated
Show resolved
Hide resolved
3147c73
to
6c2d898
Compare
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Region.java
Show resolved
Hide resolved
b4dcb80
to
b12d2ff
Compare
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.
I tested the Snippet219
and when I move from the 100% monitor to the 200% monitor I see that the region (content) is resized but the shell isn't
200% (ignore the background, it's my wallpaper)
Can you please look into that @amartya4256 ?
In such case I tend to open a text editor to get a white screen for the screenshots :-) |
I moved the shell not correctly sized example to #62 |
@amartya4256 just to be on the same page: the error I reported was there before this PR. This behavior is in the current |
de513e9
to
e9a0e9a
Compare
You can retest now. The problem was: the image in the region was scaled but not the region itself and the scaling of image has already been added to master, you could produce such behaviour. |
8233b93
to
dd6b4fa
Compare
091a7c5
to
d3e63d8
Compare
bundles/org.eclipse.swt/Eclipse SWT Tests/win32/org/eclipse/swt/graphics/RegionWin32Tests.java
Outdated
Show resolved
Hide resolved
d3e63d8
to
db33c96
Compare
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Region.java
Outdated
Show resolved
Hide resolved
06220b2
to
c00441f
Compare
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.
I like the proposed way of scaling regions by tracking the operations and applying them for a different scaling on demand rather than scaling a region itself.
However, I now see a duplication of all operations on regions, once implemented in the Region
class and once in the Operation
class. I would expect that everything related to executing an operation is moved to the Operation
class and thus completely removed from the Region
class. So I would expect all the add
/addInPixels
, translate
/... methods to only just use the Operation
class for applying an operation.
...se.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Shell.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Region.java
Outdated
Show resolved
Hide resolved
c00441f
to
3849f96
Compare
3849f96
to
58e85eb
Compare
@HeikoKlare I have adapted the Region class as per you asked and separated the changes between the 2 commits. Please have a look and let me know if it looks fien to you. |
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.
Overall, the PR looks quite good, but there are two major points that need to be addressed, one functional and one design error, for which you find more detailed information in the comments.
- Functional: operations are not applied to all already created handles
- Design: OO violation by implicit dependency between argument types in the
Operation
class.
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Region.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Region.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Region.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Region.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Region.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Region.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Region.java
Outdated
Show resolved
Hide resolved
9598424
to
52b17bc
Compare
@HeikoKlare I have addressed all the comments and implemented it accordingly. Please have a look again. |
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 redesigned implementation looks really good. I only have nipicky comments left.
I have tested the patch and did not find any regressions when using regions (when starting an SDK product with a single zoom value).
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Region.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Region.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Region.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Region.java
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Region.java
Outdated
Show resolved
Hide resolved
b0a1585
to
78fdeb7
Compare
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.
Thanks for addressing my comments! The changes look good now.
78fdeb7
to
6c817c2
Compare
Thanks, I have rebased the branch to the master as well. |
This commit adds the feature of scaling region based on the zoom level of the monitor it is drawn on. The mentioned functionality is attained by using a map to maintain the handle of the region scale as per zoom level. The handle can then be obtained by the method win32_getHandle by passing the zoom information from the client. The region object stores a history of all the operations performed on it so that it can be used to create handles for different zoom level. Additionally, this commit removes the public handle field from Region for win32 since it is now replaced by win32_getHandle method for the clients and internally the class uses a hashMap zoomToHandle to get the handle for the particular zoomlevel. The default handle is stored in zoomToHandle mapped to the initialZoom. contributes eclipse-platform#62 and eclipse-platform#127
6c817c2
to
210e208
Compare
Mentioned concerns have been addressed / are no issue with the most recent state.
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 pull request is based on the implementations of PR #1214. It extends to the native zoom which is provided within widget and propagated to GC. In this PR, the multiple zoom level functionality is attained by using a map to maintain the handle of the region scale as per zoom level. The handle can then be obtained by the method win32_getHandle by passing the zoom information from the client.
contributes to #62 and #127