Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Xenos2017-05-09 16:40:58 +0000
committerStefan Xenos2017-05-09 16:40:58 +0000
commitbf8238acb94c23742196f20574d19bf29f6018bb (patch)
tree3b1bb5088216fbf6e983a179036f8097319eb5f2
parent60aa693b09fc8a755cb794816233cc4a87bc936c (diff)
downloadeclipse.platform.ui-bf8238acb94c23742196f20574d19bf29f6018bb.tar.gz
eclipse.platform.ui-bf8238acb94c23742196f20574d19bf29f6018bb.tar.xz
eclipse.platform.ui-bf8238acb94c23742196f20574d19bf29f6018bb.zip
Bug 196692 - Section cannot handle most kinds of wrapping controls
Change the math for vertical centering such that if there is a rounding error, the twisty moves down and the label moves up. Change-Id: I87518257841dd241fdf74fb7e72827a3ce3b5b66
-rw-r--r--bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/ExpandableComposite.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/ExpandableComposite.java b/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/ExpandableComposite.java
index 1674bb64d22..d1435b882ee 100644
--- a/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/ExpandableComposite.java
+++ b/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/ExpandableComposite.java
@@ -322,7 +322,7 @@ public class ExpandableComposite extends Canvas {
if (toggle != null) {
// if label control is absent we vertically center the toggle,
// because the text client is usually a lot thicker
- int ty = (height - toggleSize.y) / 2 + 1;
+ int ty = (height - toggleSize.y + 1) / 2 + 1;
ty = Math.max(ty, 0);
ty += marginHeight + tvmargin;
toggle.setLocation(x, ty);
@@ -333,7 +333,7 @@ public class ExpandableComposite extends Canvas {
int ty = y;
if (leftAlignment) {
if (size.y < tcsize.y)
- ty = tcsize.y / 2 - size.y / 2 + marginHeight
+ ty = (tcsize.y - size.y) / 2 + marginHeight
+ tvmargin;
}
textLabelCache.setBounds(x, ty, size.x, size.y);

Back to the top