-
Notifications
You must be signed in to change notification settings - Fork 182
[win32] Calculate value for NATIVE_ZOOM on demand #2519
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
[win32] Calculate value for NATIVE_ZOOM on demand #2519
Conversation
07fe3d9
to
4b8c0fd
Compare
|
||
@Override | ||
public Object getData(String key) { | ||
if (DATA_NATIVE_ZOOM.equals(key)) { |
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.
why do we need DATA_NATIVE_ZOOM
at all?
Cant all places that currently use that key simply perform the code itself?
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.
Currently it is some kind of a hidden feature, that should be replaced in the long run by an API solution. We want to evolve the usage of this data point (e.g. in GEF as an example) with this before we introduce a unnecessary or not suitable API. But until there is a proper usable solution, we would like to at least reduce the memory footprint of that.
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.
Can you explain how/where it is used and why a "hidden key" is better than a (preliminary) API? One would suspect both to be internal and subject to change so the benefit is a bit unclear. Especially as it seems only ever a property of the shell itself.
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 this data is currently needed for an experimental feature for GEF to disable the SWT autoscaling for the diagram canvas and incorporate all scaling to GEF. There we still need the information about the zoom, that would have been applied by SWT if it was not disabled.
So, I did some discussion with @HeikoKlare and we discussed assuming the solution (which is currently there for windows) can be applied in the same way to GTK and cocoa. But we are unsure about this, so we would like to prevent adding perhaps unnecessary API. The adaption to GTK and cocoa will most likely not happen in this release cycle.
Test Results 118 files 118 suites 10m 48s ⏱️ Results for commit 29f0f3c. ♻️ This comment has been updated with latest results. |
735458c
to
f739d6a
Compare
To remove the memory footprint of Widget this commit removes the value for NATIVE_ZOOM from the data attribute and replaces it by calculating the value in Control#getData on demand. Additionally the naming is changed to SHELL_ZOOM.
f739d6a
to
29f0f3c
Compare
To remove the memory footprint of Widget this PR removes the value for NATIVE_ZOOM from the data attribute and replaces it by calculating the value in Control#getData on demand.
This does not change the value that is returned by NATIVE_ZOOM.