Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Dietisheim2010-03-18 08:52:35 +0000
committerAndre Dietisheim2010-03-18 08:52:35 +0000
commita51e099d75fd3dbd1deb585764cb7bb9e6f2186f (patch)
treeba4a503a46e722ec798bb8711e3729dad0f7caee /plugins/org.eclipse.emf.cdo.ui.branch/src/org
parenta60b23fc6c55dd77e34fe843acfcc98f1756903c (diff)
downloadcdo-a51e099d75fd3dbd1deb585764cb7bb9e6f2186f.tar.gz
cdo-a51e099d75fd3dbd1deb585764cb7bb9e6f2186f.tar.xz
cdo-a51e099d75fd3dbd1deb585764cb7bb9e6f2186f.zip
[256624] [UI] Create a Commit History ViewPart
https://bugs.eclipse.org/bugs/show_bug.cgi?id=256624 fixe tree location
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.ui.branch/src/org')
-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