-
Notifications
You must be signed in to change notification settings - Fork 190
Delegating Image(Display, String) to ImageFileNameProvider to init Image #2924
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
Conversation
Thank you @fedejeanne for testing on Mac. I will be using your screenshot for my PR description. |
f564e5f to
b6a3721
Compare
b6a3721 to
d73ad68
Compare
bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
|
I tested my original Snippet on Mac and the quality is as good as
|
0a7d45c to
a99e984
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.
This PR currently seems to lack a reference to the original issue (#2917). Would be nice to have it referenced in the commit and PR message.
I think it would also be great to add that snippet or a comparable one to the SWT snippets (may be done in a separate PR). If I am not mistaken, we have no snippet for testing SVG behavior yet, which is also why the snippets do not contain any SVG test image, so everytime you want to try something you have to copy one over. @Phillipus as you provided an extended version of the snippet in the reported issue, maybe you want to contribute it to the snippets project?
|
ce8f5ac to
2a142e4
Compare
Adapted the commit message to reference original issue. |
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.
The change looks fine and straightforward. I have a minor comment regarding the kind of refactoring (consistency with existing code structure) in the Cocoa implementation.
bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
74ee641 to
7099e36
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.
Implementation still looks good and works as expected on MacOS as well. I only have minor comments left.
bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java
Show resolved
Hide resolved
9b1facb to
3896684
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.
Code still looks good after recent changes
@ShahzaibIbrahim could you please use a proper tag for the issue reference, i.e., not use "resolves" but rather "contributes to" or the like? Since there is more necessary to resolve that issue (at least the other PR for input stream) this tag would currently close the issue (and is actually a bit misleading as it does not fully resolve the issue).
f2fba04 to
8d6505f
Compare
In GTK and Cocoa, an image based on an SVG passed as filename to Image(Device, String) will be drawn now sharply with this change. Contributes to eclipse-platform#2917
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 adapted the PR message to not resolve the referenced issue that is only partly addressed by this. Except for that, this is fine now.
Thank-you @ShahzaibIbrahim @HeikoKlare @fedejeanne |



In GTK and Cocoa, an image based on an SVG passed as filename to Image(Device, String) will be drawn now sharply with this change.
Contributes to #2917
How to Test
Run this Snippet on Windows, Mac and Linux and compare the results:
Use this SVG image for the Snippet:
Here's the outputs...
On Windows all Image methods result in sharp output:
On Mac only using ImageFileNameProvider is sharp:
On Linux only using ImageFileNameProvider is sharp:
After Fix
Image use for testing:

GTK:
Cocoa: