-
Notifications
You must be signed in to change notification settings - Fork 166
Deprecate Image(Rectangle) constructor and replace usages #2088
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
Test Results 539 files - 6 539 suites - 6 30m 8s ⏱️ + 1m 34s For more details on these failures, see this check. Results for commit de604cc. ± Comparison against base commit 5d05f5a. This pull request removes 37 and adds 1 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
As far as I can tell, this constructor is currently often used to take screenshots from Displays or Controls. |
fa34257
to
b504ee4
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.
As far as I can tell, this constructor is currently often used to take screenshots from Displays or Controls.
That means it's a convenience constructor for the case where you have bounds (as rectangle) at hand, but the decision was actually questionable as such bounds may have x/y != 0, which has no proper meaning when using this constructor.
So having specific API for the screenshot use cae as proposed in #2104 would be nice.
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
...e.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Image.java
Outdated
Show resolved
Hide resolved
5170784
to
4cb5414
Compare
Deprecate Image constructor that accepts Rectangle in favor of Image(display, width, height).
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 replaced some usages of the deprecated constructor in GTK and added a new test for the preferred constructor
Test failure unrelated: #2113 |
Please process the PRs replacing the consumers as soon as possible (e.g., eclipse-platform/eclipse.platform.ui#2953). In general, it would be best to replace all known consumers before deprecating the method. |
... it was always my plan :-) |
Deprecate Image constructor that accepts Rectangle in favor of Image(display, width, height).