summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Wouters2014-02-27 02:30:37 (EST)
committerLaurent Wouters2014-02-27 04:25:55 (EST)
commitdb21597e8d7c8c22c8cd2c8adb306d7d4807efd3 (patch)
tree283049ea43dd8bdc7c09b3ae601f7ac44516722e
parentc4096338ea5dc3f25f14fd1c411e512a422f8305 (diff)
downloadorg.eclipse.papyrus-db21597e8d7c8c22c8cd2c8adb306d7d4807efd3.zip
org.eclipse.papyrus-db21597e8d7c8c22c8cd2c8adb306d7d4807efd3.tar.gz
org.eclipse.papyrus-db21597e8d7c8c22c8cd2c8adb306d7d4807efd3.tar.bz2
425584: Fixed issue with 0-length dashes
https://bugs.eclipse.org/bugs/show_bug.cgi?id=425584 Signed-off-by: Laurent Wouters <laurent.wouters@cea.fr>
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ConnectionEditPart.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ConnectionEditPart.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ConnectionEditPart.java
index b9b684d..4b51871 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ConnectionEditPart.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ConnectionEditPart.java
@@ -44,6 +44,16 @@ public abstract class ConnectionEditPart extends ConnectionNodeEditPart implemen
*/
protected static final String LINE_DASH_GAP = "lineDashGap";
+ /**
+ * Minimum length of dashes for dashed connectors
+ */
+ protected static final int LINE_DASH_MIN_LENGTH = 2;
+
+ /**
+ * Minimum length of the gapas between dashes
+ */
+ protected static final int LINE_GAP_MIN_LENGTH = 2;
+
public ConnectionEditPart(View view) {
super(view);
}
@@ -63,7 +73,7 @@ public abstract class ConnectionEditPart extends ConnectionNodeEditPart implemen
int lineDashLength = extract((IntValueStyle)connector.getNamedStyle(NotationPackage.eINSTANCE.getIntValueStyle(), LINE_DASH_LENGTH));
int lineDashGap = extract((IntValueStyle)connector.getNamedStyle(NotationPackage.eINSTANCE.getIntValueStyle(), LINE_DASH_GAP));
if(lineStyle != null) {
- setupLineStyle(edge, lineStyle, connector.getLineWidth(), lineDashLength, lineDashGap);
+ setupLineStyle(edge, lineStyle, connector.getLineWidth(), lineDashLength < LINE_DASH_MIN_LENGTH ? LINE_DASH_MIN_LENGTH : lineDashLength, lineDashGap < LINE_GAP_MIN_LENGTH ? LINE_GAP_MIN_LENGTH : lineDashGap);
} else {
edge.resetStyle();
}