diff --git a/org.eclipse.zest.layouts/src/org/eclipse/zest/layouts/algorithms/AlgorithmHelper.java b/org.eclipse.zest.layouts/src/org/eclipse/zest/layouts/algorithms/AlgorithmHelper.java index dfcd09dd4..057ba0544 100644 --- a/org.eclipse.zest.layouts/src/org/eclipse/zest/layouts/algorithms/AlgorithmHelper.java +++ b/org.eclipse.zest.layouts/src/org/eclipse/zest/layouts/algorithms/AlgorithmHelper.java @@ -56,9 +56,8 @@ public static void fitWithinBounds(EntityLayout[] entities, DisplayIndependentRe entity.setSize(size.width, size.height); } - location.x = destinationBounds.x + size.width / 2 + percentX * (destinationBounds.width - size.width); - location.y = destinationBounds.y + size.height / 2 - + percentY * (destinationBounds.height - size.height); + location.x = destinationBounds.x + percentX * (destinationBounds.width - size.width); + location.y = destinationBounds.y + percentY * (destinationBounds.height - size.height); entity.setLocation(location.x, location.y); } else if (resize && entity.isResizable()) { diff --git a/org.eclipse.zest.layouts/src/org/eclipse/zest/layouts/algorithms/GridLayoutAlgorithm.java b/org.eclipse.zest.layouts/src/org/eclipse/zest/layouts/algorithms/GridLayoutAlgorithm.java index b0e1290b3..23ba98141 100644 --- a/org.eclipse.zest.layouts/src/org/eclipse/zest/layouts/algorithms/GridLayoutAlgorithm.java +++ b/org.eclipse.zest.layouts/src/org/eclipse/zest/layouts/algorithms/GridLayoutAlgorithm.java @@ -385,9 +385,8 @@ protected synchronized void applyLayoutInternal(EntityLayout[] entitiesToLayout, node.setSize(Math.max(childrenWidth, MIN_ENTITY_SIZE), Math.max(childrenHeight, MIN_ENTITY_SIZE)); } - DisplayIndependentDimension size = node.getSize(); - double xmove = bounds.x + j * colWidth + offsetX + size.width / 2; - double ymove = bounds.y + i * rowHeight + offsetY + size.height / 2; + double xmove = bounds.x + j * colWidth + offsetX; + double ymove = bounds.y + i * rowHeight + offsetY; if (node.isMovable()) { node.setLocation(xmove, ymove); }