diff options
| author | Laurent Redor | 2016-06-17 19:47:22 +0000 |
|---|---|---|
| committer | Laurent Redor | 2016-07-06 14:00:34 +0000 |
| commit | 656a1a52e2e29e08e77d783fa2e690a140311ffb (patch) | |
| tree | 164338867d2cae18eeaccb2e2041fa6caa909848 | |
| parent | 867a7c3dd81b7c3bbea839d27c7be985a7d7d85e (diff) | |
| download | org.eclipse.sirius-656a1a52e2e29e08e77d783fa2e690a140311ffb.tar.gz org.eclipse.sirius-656a1a52e2e29e08e77d783fa2e690a140311ffb.tar.xz org.eclipse.sirius-656a1a52e2e29e08e77d783fa2e690a140311ffb.zip | |
[495119] Fix pb of collapsing last region in horizontal stack
Since previous commit for bug 495119 (Compute GMF regions size according
to container size), there is a regression on collapsing the last region
in horizontal stack (a blank space remains if the regions container is
not in auto-size).
In AirXYLayoutEditPolicy [1], the constraint of a regions container is
force to "-1" for height (see commit 77d6b284 and method
getConstraintFor). This is for facility reason to handle the case when
the label is hidden/shown. This "-1" explains the difference between
HStack
and VStack when collapsing the last region. For the same facility
reason, the width is also constraint to "-1" here. A clean way would be
to set this "-1" directly during the resize command.
[1]
org.eclipse.sirius.diagram.ui.graphical.edit.policies.AirXYLayoutEditPolicy
Bug: 495119
Change-Id: I5b9e537bb14bd87c449bb1311456b0c22ba62225
Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
| -rw-r--r-- | plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/AirXYLayoutEditPolicy.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/AirXYLayoutEditPolicy.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/AirXYLayoutEditPolicy.java index dc911853d8..7a0128c311 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/AirXYLayoutEditPolicy.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/AirXYLayoutEditPolicy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2016 THALES GLOBAL SERVICES. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -231,12 +231,12 @@ public class AirXYLayoutEditPolicy extends XYLayoutEditPolicy { */ childEditPolicy = new RegionRegionContainerResizableEditPolicy(); } else { - /* - * If the current element is a region container, each added child - * will be considered as a region and will receive the expected - * resizable edit policy. - */ - childEditPolicy = new RegionResizableEditPolicy(); + /* + * If the current element is a region container, each added + * child will be considered as a region and will receive the + * expected resizable edit policy. + */ + childEditPolicy = new RegionResizableEditPolicy(); } } else if (isRegionContainer(child)) { /* If the added element is a region container. */ @@ -306,6 +306,7 @@ public class AirXYLayoutEditPolicy extends XYLayoutEditPolicy { Object constraintFor = super.getConstraintFor(request, child, rect); if (constraintFor instanceof Rectangle && isRegionContainer(child)) { Rectangle rectangle = (Rectangle) constraintFor; + rectangle.setWidth(-1); rectangle.setHeight(-1); } return constraintFor; |
