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$
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_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_WIDTH;
import static org.fortiss.tooling.base.ui.utils.EllipseLayoutUtils.calculateEllipseBorderPoint;
......@@ -46,7 +47,7 @@ import org.fortiss.tooling.base.ui.utils.EllipseLayoutUtils.Polar;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 15F97A0D63FF406F7D107915D03B110F
* @ConQAT.Rating YELLOW Hash: 4736CA2DB316F3869AE846AD92A44E35
*/
public class EllipseCurveLayoutDiagramConfiguration extends
DiagramLayoutConfigurationBase {
......@@ -101,7 +102,8 @@ public class EllipseCurveLayoutDiagramConfiguration extends
ChangeBoundsRequest request,
StickyConnectorEditPartBase<? extends ILayoutedModelElement> connectorEditPart,
IFigure connectorFigure) {
ILayoutedModelElement stickyConnectorModel = connectorEditPart.getModel();
ILayoutedModelElement stickyConnectorModel = connectorEditPart
.getModel();
double angle = getConnectorAngleAsDouble(stickyConnectorModel);
// compute old bounds
......@@ -137,11 +139,18 @@ public class EllipseCurveLayoutDiagramConfiguration extends
Dimension oldSize = new Dimension(elementBounds.width
+ oldSizeDelta.width, elementBounds.height
+ oldSizeDelta.height);
Dimension minimal = getMinimalElementSize();
Dimension newSize = clampEllipseShapeSize(oldSize,
request.getResizeDirection());
request.getResizeDirection(), minimal.width, minimal.height,
getAspectRatio());
Dimension newSizeDelta = new Dimension(newSize.width
- elementBounds.width, newSize.height - elementBounds.height);
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;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: FE97BBE22F4CC3FACA47CD3F91ADCE5D
* @ConQAT.Rating YELLOW Hash: 412BCCEA0E2EF9D3B58DC15887A4D43D
*/
public class RectangleGridLayoutDiagramConfiguration extends
DiagramLayoutConfigurationBase {
......@@ -150,8 +150,9 @@ public class RectangleGridLayoutDiagramConfiguration extends
Rectangle bounds = elementEditPart.getFigure().getBounds();
Dimension oldSize = new Dimension(bounds.width + oldSizeDelta.width,
bounds.height + oldSizeDelta.height);
Dimension newSize = clampRectangularShapeSize(oldSize,
MINIMUM_SIZE.width, MINIMUM_SIZE.height);
Dimension minimal = getMinimalElementSize();
Dimension newSize = clampRectangularShapeSize(oldSize, minimal.width,
minimal.height);
Dimension newSizeDelta = new Dimension(newSize.width - bounds.width,
newSize.height - bounds.height);
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