-
Notifications
You must be signed in to change notification settings - Fork 187
[win32] Introduce ZoomContext in Image #2404
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] Introduce ZoomContext in Image #2404
Conversation
8f8cb1e to
52375f4
Compare
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
52375f4 to
697f5cf
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 updates of the PR!
The change is sound and adds the necessary capabilities for properly distinguishing native and target zoom to the Image class. This change alone (without the follow-up changes) does not have any user-perceivable effect. I tested with different auto-scale settings (monitor-specific on/off, fixed auto-scale) and did not find any changes in behavior.
This commit extends the internal zoom used in Image in the windows implementation to a complex object. This is preparatory work to provide a consistent behavior independent of the auto scale mode, e.g. when an Image is drawn with a GC.
697f5cf to
16da749
Compare
This PR extends the internal zoom used in Image in the windows implementation to a complex object. This is preparatory work to provide a consistent behavior independent of the auto scale mode, e.g. when an Image is drawn with a GC.
The introduced ZoomContext is only used in one place with two different values for targetZoom and nativeZoom, in Image#applyUsingAnyHandle. This is the correct way to fill ZoomContext here, but the zoom does not matter for the usages of this method anyway.
The complex
ZoomComplexobject introduced inImageis a first step in unifying zoom semantics. We noticed that depending on the configured autoscale mode, different zoom calculations must be used. This led to multiple regressions in the previous releases. One simple example is the font zoom. In most cases it is equal to the native zoom of the monitor or primary monitor. With a fixed zoom, it should use the fixed zoom instead.The goal is to move this logic into the (probably windows only)
ZoomContextobject, that will provide an abstract layer for this and hopefully improves testability as well.