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 Support for region for win32 #1278

Merged

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 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

@amartya4256 amartya4256 requested a review from niraj-modi as a code owner June 12, 2024 13:58
Copy link
Contributor

github-actions bot commented Jun 12, 2024

Test Results

   478 files  +8     478 suites  +8   7m 33s ⏱️ -24s
 4 137 tests +2   4 129 ✅ +2   8 💤 ±0  0 ❌ ±0 
16 341 runs  +5  16 249 ✅ +5  92 💤 ±0  0 ❌ ±0 

Results for commit 210e208. ± Comparison against base commit 69af8e1.

♻️ 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.

The code doesn't compile.

Also, there's a typo.

@amartya4256 amartya4256 force-pushed the multi_zoom_level_region branch 2 times, most recently from 3147c73 to 6c2d898 Compare June 14, 2024 12:58
@amartya4256 amartya4256 force-pushed the multi_zoom_level_region branch 2 times, most recently from b4dcb80 to b12d2ff Compare June 17, 2024 13:38
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.

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

100%
image

200% (ignore the background, it's my wallpaper)
image

Can you please look into that @amartya4256 ?

@laeubi
Copy link
Contributor

laeubi commented Jun 19, 2024

ignore the background, it's my wallpaper

In such case I tend to open a text editor to get a white screen for the screenshots :-)

@vogella
Copy link
Contributor

vogella commented Jun 19, 2024

I moved the shell not correctly sized example to #62

@fedejeanne
Copy link
Contributor

@amartya4256 just to be on the same page: the error I reported was there before this PR.

This behavior is in the current master branch (I switch from the 100% monitor on the left to the 200% monitor on the right):

Snippet219_multi_monitor

@amartya4256 amartya4256 force-pushed the multi_zoom_level_region branch from de513e9 to e9a0e9a Compare June 19, 2024 13:36
@amartya4256
Copy link
Contributor Author

amartya4256 commented Jun 20, 2024

@amartya4256 just to be on the same page: the error I reported was there before this PR.

This behavior is in the current master branch (I switch from the 100% monitor on the left to the 200% monitor on the right):

Snippet219_multi_monitor Snippet219_multi_monitor

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.

@amartya4256 amartya4256 force-pushed the multi_zoom_level_region branch 3 times, most recently from 8233b93 to dd6b4fa Compare June 26, 2024 13:41
@amartya4256 amartya4256 force-pushed the multi_zoom_level_region branch 2 times, most recently from 091a7c5 to d3e63d8 Compare June 26, 2024 16:14
@amartya4256 amartya4256 force-pushed the multi_zoom_level_region branch from d3e63d8 to db33c96 Compare June 27, 2024 08:44
@amartya4256 amartya4256 force-pushed the multi_zoom_level_region branch 4 times, most recently from 06220b2 to c00441f Compare June 27, 2024 11:47
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 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.

@amartya4256 amartya4256 force-pushed the multi_zoom_level_region branch from c00441f to 3849f96 Compare June 28, 2024 09:39
@amartya4256 amartya4256 force-pushed the multi_zoom_level_region branch from 3849f96 to 58e85eb Compare June 28, 2024 11:16
@amartya4256
Copy link
Contributor Author

@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.

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.

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.

@amartya4256 amartya4256 force-pushed the multi_zoom_level_region branch 3 times, most recently from 9598424 to 52b17bc Compare July 2, 2024 15:11
@amartya4256
Copy link
Contributor Author

@HeikoKlare I have addressed all the comments and implemented it accordingly. Please have a look again.

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 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).

@amartya4256 amartya4256 force-pushed the multi_zoom_level_region branch 2 times, most recently from b0a1585 to 78fdeb7 Compare July 4, 2024 10:58
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.

Thanks for addressing my comments! The changes look good now.

@amartya4256 amartya4256 force-pushed the multi_zoom_level_region branch from 78fdeb7 to 6c817c2 Compare July 4, 2024 11:59
@amartya4256
Copy link
Contributor Author

Thanks for addressing my comments! The changes look good now.

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
@HeikoKlare HeikoKlare force-pushed the multi_zoom_level_region branch from 6c817c2 to 210e208 Compare July 4, 2024 14:42
@HeikoKlare
Copy link
Contributor

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

100% image

200% (ignore the background, it's my wallpaper) image

I have tested the behavior with the current PR state: it works fine and as expected.

@HeikoKlare HeikoKlare dismissed fedejeanne’s stale review July 4, 2024 15:44

Mentioned concerns have been addressed / are no issue with the most recent state.

@HeikoKlare HeikoKlare merged commit 80086c9 into eclipse-platform:master Jul 4, 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.

6 participants