Deprecate Image(Rectangle) constructor and replace usages#2088
Deprecate Image(Rectangle) constructor and replace usages#2088fedejeanne merged 1 commit intoeclipse-platform:masterfrom
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
HeikoKlare
left a comment
There was a problem hiding this comment.
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).
fedejeanne
left a comment
There was a problem hiding this comment.
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).