Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.branch/src/org/eclipse/emf/cdo/ui/internal/branch/geometry/GeometryUtils.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.branch/src/org/eclipse/emf/cdo/ui/internal/branch/layout/BranchTreeLayoutAlgorithm.java2
2 files changed, 5 insertions, 5 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui.branch/src/org/eclipse/emf/cdo/ui/internal/branch/geometry/GeometryUtils.java b/plugins/org.eclipse.emf.cdo.ui.branch/src/org/eclipse/emf/cdo/ui/internal/branch/geometry/GeometryUtils.java
index e6e4d30ce8..5a76cd3cc6 100644
--- a/plugins/org.eclipse.emf.cdo.ui.branch/src/org/eclipse/emf/cdo/ui/internal/branch/geometry/GeometryUtils.java
+++ b/plugins/org.eclipse.emf.cdo.ui.branch/src/org/eclipse/emf/cdo/ui/internal/branch/geometry/GeometryUtils.java
@@ -160,19 +160,19 @@ public class GeometryUtils
}
/**
- * Subtracts the given height and width from the given rectangle.
+ * Subtracts the given height and width from the given rectangle and move its origin by the half of the given values.
*
* @param dimension
* the dimension
* @param rectangle
* the rectangle
*/
- public static DisplayIndependentRectangle substract(DisplayIndependentDimension dimension,
+ public static DisplayIndependentRectangle substractBorder(DisplayIndependentDimension dimension,
DisplayIndependentRectangle rectangle)
{
DisplayIndependentRectangle newRectangle = new DisplayIndependentRectangle();
- newRectangle.x = dimension.width;
- newRectangle.y = dimension.height;
+ newRectangle.x = rectangle.x + dimension.width / 2;
+ newRectangle.y = rectangle.y + dimension.height / 2;
newRectangle.width = rectangle.width - dimension.width;
newRectangle.height = rectangle.height - dimension.height;
return newRectangle;
diff --git a/plugins/org.eclipse.emf.cdo.ui.branch/src/org/eclipse/emf/cdo/ui/internal/branch/layout/BranchTreeLayoutAlgorithm.java b/plugins/org.eclipse.emf.cdo.ui.branch/src/org/eclipse/emf/cdo/ui/internal/branch/layout/BranchTreeLayoutAlgorithm.java
index ee0987b0b8..e61608544b 100644
--- a/plugins/org.eclipse.emf.cdo.ui.branch/src/org/eclipse/emf/cdo/ui/internal/branch/layout/BranchTreeLayoutAlgorithm.java
+++ b/plugins/org.eclipse.emf.cdo.ui.branch/src/org/eclipse/emf/cdo/ui/internal/branch/layout/BranchTreeLayoutAlgorithm.java
@@ -125,7 +125,7 @@ public class BranchTreeLayoutAlgorithm extends AbstractLayoutAlgorithm
private void fitWithinBounds(BranchView branchView)
{
- DisplayIndependentRectangle boundsWithBorder = GeometryUtils.substract(borders, layoutBounds);
+ DisplayIndependentRectangle boundsWithBorder = GeometryUtils.substractBorder(borders, layoutBounds);
branchView.getLayoutStrategy().scale(branchView, boundsWithBorder);
}

Back to the top