-
Notifications
You must be signed in to change notification settings - Fork 191
Fix GC#drawImage methods with additional Transformation #2934
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
Fix GC#drawImage methods with additional Transformation #2934
Conversation
|
Have tested the changes myself and can see it fixes the said issue. |
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
Outdated
Show resolved
Hide resolved
f9c3b63 to
35f2d85
Compare
ad4b117 to
3264f8b
Compare
3264f8b to
be0c37d
Compare
be0c37d to
fca51c4
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.
There is an attempt to fix the issue with wrongly scaled image data being used when a transform is applied for GEF:
We should check if that issue is resolved with this PR as well and there is also a snippet in there to may better test these changes.
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
Outdated
Show resolved
Hide resolved
1cb3562 to
c4c66ad
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.
LGTM, I only rebased, moved a bit of code around and added a comment with my commits. Still I would ask for a second approval (@HeikoKlare)
I tested especially with Snippet389 and a slightly adjusted version to test with the eclipse16.svg to ensure is is really creating the perfect solution when putting in high scale factors
2d3814d to
21b2aa3
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.
I also tested with snippet 389 and an SVG and found this to work fine for the drawImage methods that allow scaling. The drawImage(image, x, y) method is not fixed yet and will be part of a subsequent PR. That one will then also address eclipse-gef/gef-classic#922.
This is the snippet with the eclipse.svg and scale 20 before this change:

This is the snippet with the eclipse.svg and scale 20 after this change:

I've just adapted the commit message to refer to the addressed issue.
…tform#2919 If a transform is applied via the GC, then both drawImage methods consider now the best fitting handle by requesting it through the width/height of the full image scaled by the scaleFactor (relating destination width/height to source width/height) times the width/height scaling induced by the transformation. Contributes to eclipse-platform#2919
21b2aa3 to
b629e45
Compare
If a transform is applied via the GC, then both drawImage APIs consider now the best fitting handle by requesting it through the width/height of the full image scaled by the scaleFactor (relating destination width/height to source width/height) times the width/height scaling induced by the transformation.
Note that only the second commit is relevant for the PR. The first one references to the changes made in #2913.
To easily see and test, use the following snippet:
Below are screenshots of the snippet on a 100% zoom.
Before:

After:

Contributes to #2919