diff options
| author | Florian Barbin | 2018-04-18 11:49:49 +0000 |
|---|---|---|
| committer | Laurent Redor | 2018-04-26 08:01:25 +0000 |
| commit | 8c12ea816f9f8e4a1f71c3bf0b5c2a6e5b662654 (patch) | |
| tree | f6474faefa6a57b24679547911c89e0b3857fc5f | |
| parent | aa052272035c2d439cb4499a1f51f770858c8ed6 (diff) | |
| download | org.eclipse.sirius-8c12ea816f9f8e4a1f71c3bf0b5c2a6e5b662654.tar.gz org.eclipse.sirius-8c12ea816f9f8e4a1f71c3bf0b5c2a6e5b662654.tar.xz org.eclipse.sirius-8c12ea816f9f8e4a1f71c3bf0b5c2a6e5b662654.zip | |
[509070] Handle auto-size during arrange all
* During the arrange-all, the auto-sized is set on the figure constraint
before the GMF bounds. If the figure is auto-size, we do not replace the
constraint by the current GMF bounds for move request.
* This commit fixes the ContainerDefaultSizeLayoutTest.
Bug: 509070
Change-Id: Ibd6c5094d4051e0ab331b5d5ecd55a52805a261d
Signed-off-by: Florian Barbin <florian.barbin@obeo.fr>
| -rw-r--r-- | plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/AirXYLayoutEditPolicy.java | 4 |
1 files changed, 3 insertions, 1 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 deeb24ac42..53dc4daa33 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 @@ -339,7 +339,9 @@ public class AirXYLayoutEditPolicy extends XYLayoutEditPolicy { // If the request is a move request, there is no reason to override the size of the GMF Node with the current // figure size. In some cases, the GMF Bounds may have been updated but the figure has not been refreshed yet. - if (REQ_MOVE_CHILDREN.equals(request.getType())) { + // Note that the auto-size is a particular case (-1): during an arrange all, the figure constraint is set before + // the GMF bounds. + if (REQ_MOVE_CHILDREN.equals(request.getType()) && (constraint.width() != -1 && constraint.height() != -1)) { // We retrieve the Size of the GMF Node attached to the edit part. Optional<Size> optionalSize = Optional.ofNullable(child.getModel()).filter(Node.class::isInstance).map(model -> ((Node) model).getLayoutConstraint()).filter(Size.class::isInstance) .map(Size.class::cast); |
