Skip to content

Commit 2c024c0

Browse files
committed
Added SwtMisc.globalBounds for ControlWrapper.
1 parent fcce1ac commit 2c024c0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Shells no longer set their image on Mac, so that they don't hijack the dock icon.
99
- Added `ControlWrapper.transparent` for efficiently passing `Control` to `ControlWrapper`.
1010
- Improved `StructuredDrop.handler`.
11+
- Added `SwtMisc.globalBounds` for `ControlWrapper`.
1112

1213
### Version 3.2.1 - August 7th 2019 ([javadoc](http://diffplug.github.io/durian-swt/javadoc/3.2.1/), [jcenter](https://bintray.com/diffplug/opensource/durian-swt/3.2.1/view))
1314

durian-swt/src/main/java/com/diffplug/common/swt/SwtMisc.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,11 @@ public static Rectangle globalBounds(Control control) {
452452
return new Rectangle(topLeft.x, topLeft.y, size.x, size.y);
453453
}
454454

455+
/** Returns the global bounds of the given ControlWrapper. */
456+
public static Rectangle globalBounds(ControlWrapper control) {
457+
return globalBounds(control.getRootControl());
458+
}
459+
455460
/** Converts a rectangle to global coordinates using the given control as a reference frame. */
456461
public static Rectangle toDisplay(Control control, Rectangle rect) {
457462
Point topLeft = control.toDisplay(rect.x, rect.y);

0 commit comments

Comments
 (0)