]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/actions/AddComponentAction.java
Allow insertion of components at the ends of straight segments
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / actions / AddComponentAction.java
index 8dcee92610f00f8fea6afc1a1114d949cc787e1f..dae8c629b4335a7bfacb88503086d7d34285311b 100644 (file)
@@ -76,13 +76,13 @@ public class AddComponentAction extends vtkSwtAction {
                                allowed.add(PositionType.NEXT);
                        }  
                } else {
-                       if (component.getNext() == null) {
+                       if (component.getNext() == null || component.getControlPoint().isVariableLength()) {
                                allowed.add(PositionType.NEXT);
                        }
-                       if (component.getPrevious() == null) {
+                       if (component.getPrevious() == null || component.getControlPoint().isVariableLength()) {
                                allowed.add(PositionType.PREVIOUS);
                        }
-                       if (component instanceof InlineComponent && !component.getControlPoint().isFixedLength()){
+                       if (component instanceof InlineComponent && component.getControlPoint().isVariableLength()){
                                allowed.add(PositionType.SPLIT);
                        }
                }