diff options
author | Silenio Quarti <silenio> | 2004-05-26 22:51:33 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2004-05-26 22:51:33 +0000 |
commit | e4c9aeb111236ba133197a761c1ece6393dd4ea5 (patch) | |
tree | 766f3f4332b6f40fba974160338cb5f9b736f415 | |
parent | 080b55c089b6da213622973bb9a887999c3981a8 (diff) | |
download | eclipse.platform.swt-e4c9aeb111236ba133197a761c1ece6393dd4ea5.tar.gz eclipse.platform.swt-e4c9aeb111236ba133197a761c1ece6393dd4ea5.tar.xz eclipse.platform.swt-e4c9aeb111236ba133197a761c1ece6393dd4ea5.zip |
45574
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Group.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Group.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Group.java index ab3030b204..9f6e5cd6f1 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Group.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Group.java @@ -93,13 +93,22 @@ protected void checkSubclass () { public Rectangle computeTrim (int x, int y, int width, int height) { checkWidget (); - Rect bounds = new Rect (); - OS.GetControlBounds (handle, bounds); + Rect bounds, oldBounds = new Rect (); + OS.GetControlBounds (handle, oldBounds); + boolean fixBounds = (oldBounds.right - oldBounds.left) < 100 || (oldBounds.bottom - oldBounds.top) < 100; + if (fixBounds) { + bounds = new Rect (); + bounds.right = bounds.bottom = 100; + OS.SetControlBounds (handle, bounds); + } else { + bounds = oldBounds; + } int rgnHandle = OS.NewRgn (); OS.GetControlRegion (handle, (short)OS.kControlContentMetaPart, rgnHandle); Rect client = new Rect (); OS.GetRegionBounds (rgnHandle, client); OS.DisposeRgn (rgnHandle); + if (fixBounds) OS.SetControlBounds (handle, oldBounds); x -= client.left - bounds.left; y -= client.top - bounds.top; width += Math.max (8, (bounds.right - bounds.left) - (client.right - client.left)); |