Skip to content
Snippets Groups Projects
Commit 4fcfecdb authored by Florian Hölzl's avatar Florian Hölzl
Browse files

bugfix => YELLOW

refs 512
parent 6cc12200
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,7 @@ $Id$ ...@@ -18,6 +18,7 @@ $Id$
package org.fortiss.tooling.base.ui.layout; package org.fortiss.tooling.base.ui.layout;
import static org.fortiss.tooling.base.layout.DefaultLayoutConstants.DEFAULT_CONNECTOR_SIZE; import static org.fortiss.tooling.base.layout.DefaultLayoutConstants.DEFAULT_CONNECTOR_SIZE;
import static org.fortiss.tooling.base.layout.DefaultLayoutConstants.DEFAULT_SHAPE_ASPECT_RATIO;
import static org.fortiss.tooling.base.layout.DefaultLayoutConstants.DEFAULT_SHAPE_MINIMUM_HEIGHT; import static org.fortiss.tooling.base.layout.DefaultLayoutConstants.DEFAULT_SHAPE_MINIMUM_HEIGHT;
import static org.fortiss.tooling.base.layout.DefaultLayoutConstants.DEFAULT_SHAPE_MINIMUM_WIDTH; import static org.fortiss.tooling.base.layout.DefaultLayoutConstants.DEFAULT_SHAPE_MINIMUM_WIDTH;
import static org.fortiss.tooling.base.ui.utils.EllipseLayoutUtils.calculateEllipseBorderPoint; import static org.fortiss.tooling.base.ui.utils.EllipseLayoutUtils.calculateEllipseBorderPoint;
...@@ -46,7 +47,7 @@ import org.fortiss.tooling.base.ui.utils.EllipseLayoutUtils.Polar; ...@@ -46,7 +47,7 @@ import org.fortiss.tooling.base.ui.utils.EllipseLayoutUtils.Polar;
* @author hoelzl * @author hoelzl
* @author $Author$ * @author $Author$
* @version $Rev$ * @version $Rev$
* @ConQAT.Rating GREEN Hash: 15F97A0D63FF406F7D107915D03B110F * @ConQAT.Rating YELLOW Hash: 4736CA2DB316F3869AE846AD92A44E35
*/ */
public class EllipseCurveLayoutDiagramConfiguration extends public class EllipseCurveLayoutDiagramConfiguration extends
DiagramLayoutConfigurationBase { DiagramLayoutConfigurationBase {
...@@ -101,7 +102,8 @@ public class EllipseCurveLayoutDiagramConfiguration extends ...@@ -101,7 +102,8 @@ public class EllipseCurveLayoutDiagramConfiguration extends
ChangeBoundsRequest request, ChangeBoundsRequest request,
StickyConnectorEditPartBase<? extends ILayoutedModelElement> connectorEditPart, StickyConnectorEditPartBase<? extends ILayoutedModelElement> connectorEditPart,
IFigure connectorFigure) { IFigure connectorFigure) {
ILayoutedModelElement stickyConnectorModel = connectorEditPart.getModel(); ILayoutedModelElement stickyConnectorModel = connectorEditPart
.getModel();
double angle = getConnectorAngleAsDouble(stickyConnectorModel); double angle = getConnectorAngleAsDouble(stickyConnectorModel);
// compute old bounds // compute old bounds
...@@ -137,11 +139,18 @@ public class EllipseCurveLayoutDiagramConfiguration extends ...@@ -137,11 +139,18 @@ public class EllipseCurveLayoutDiagramConfiguration extends
Dimension oldSize = new Dimension(elementBounds.width Dimension oldSize = new Dimension(elementBounds.width
+ oldSizeDelta.width, elementBounds.height + oldSizeDelta.width, elementBounds.height
+ oldSizeDelta.height); + oldSizeDelta.height);
Dimension minimal = getMinimalElementSize();
Dimension newSize = clampEllipseShapeSize(oldSize, Dimension newSize = clampEllipseShapeSize(oldSize,
request.getResizeDirection()); request.getResizeDirection(), minimal.width, minimal.height,
getAspectRatio());
Dimension newSizeDelta = new Dimension(newSize.width Dimension newSizeDelta = new Dimension(newSize.width
- elementBounds.width, newSize.height - elementBounds.height); - elementBounds.width, newSize.height - elementBounds.height);
request.setSizeDelta(newSizeDelta); request.setSizeDelta(newSizeDelta);
} }
/** Returns the aspect ratio to be used for ellipse resizing. */
public double getAspectRatio() {
return DEFAULT_SHAPE_ASPECT_RATIO;
}
} }
...@@ -52,7 +52,7 @@ import org.fortiss.tooling.base.ui.utils.LayoutDataUtils; ...@@ -52,7 +52,7 @@ import org.fortiss.tooling.base.ui.utils.LayoutDataUtils;
* @author hoelzl * @author hoelzl
* @author $Author$ * @author $Author$
* @version $Rev$ * @version $Rev$
* @ConQAT.Rating GREEN Hash: FE97BBE22F4CC3FACA47CD3F91ADCE5D * @ConQAT.Rating YELLOW Hash: 412BCCEA0E2EF9D3B58DC15887A4D43D
*/ */
public class RectangleGridLayoutDiagramConfiguration extends public class RectangleGridLayoutDiagramConfiguration extends
DiagramLayoutConfigurationBase { DiagramLayoutConfigurationBase {
...@@ -150,8 +150,9 @@ public class RectangleGridLayoutDiagramConfiguration extends ...@@ -150,8 +150,9 @@ public class RectangleGridLayoutDiagramConfiguration extends
Rectangle bounds = elementEditPart.getFigure().getBounds(); Rectangle bounds = elementEditPart.getFigure().getBounds();
Dimension oldSize = new Dimension(bounds.width + oldSizeDelta.width, Dimension oldSize = new Dimension(bounds.width + oldSizeDelta.width,
bounds.height + oldSizeDelta.height); bounds.height + oldSizeDelta.height);
Dimension newSize = clampRectangularShapeSize(oldSize, Dimension minimal = getMinimalElementSize();
MINIMUM_SIZE.width, MINIMUM_SIZE.height); Dimension newSize = clampRectangularShapeSize(oldSize, minimal.width,
minimal.height);
Dimension newSizeDelta = new Dimension(newSize.width - bounds.width, Dimension newSizeDelta = new Dimension(newSize.width - bounds.width,
newSize.height - bounds.height); newSize.height - bounds.height);
request.setSizeDelta(newSizeDelta); request.setSizeDelta(newSizeDelta);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment