From: Jussi Koskela Date: Thu, 22 Aug 2019 11:20:01 +0000 (+0300) Subject: Support subrelations of DIA.Flag.ConnectionPoint in Diagram.setElements X-Git-Tag: v1.43.0~136^2~98 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=0f7642b3bd653687a880733e4673b450e3612c6c;p=simantics%2Fplatform.git Support subrelations of DIA.Flag.ConnectionPoint in Diagram.setElements gitlab #359 Change-Id: I070a1615057c7f17a55e43bdb975712201f3d710 --- diff --git a/bundles/org.simantics.modeling/scl/Simantics/Diagram.scl b/bundles/org.simantics.modeling/scl/Simantics/Diagram.scl index 14a558bec..451bda827 100644 --- a/bundles/org.simantics.modeling/scl/Simantics/Diagram.scl +++ b/bundles/org.simantics.modeling/scl/Simantics/Diagram.scl @@ -512,10 +512,7 @@ setElements (DiagramInfo diagram configuration componentMap) joinMap elementSpec Just connection createNode connection (Terminal elementName terminal) = do element = newOrMappedElement elementName - if terminal == DIA.Flag.ConnectionPoint then - createConnector connection element terminal DIA.HasPlainConnector - else - createConnector connection element terminal DIA.HasPlainConnector + createConnector connection element terminal DIA.HasPlainConnector createNode connection (RouteLine isHorizontal position) = do newEntity [ hasName (freshElementName ()), @@ -552,7 +549,7 @@ setElements (DiagramInfo diagram configuration componentMap) joinMap elementSpec claim a DIA.AreConnected b // Returns (connectionRelation :: Maybe Resource, connector attachment relation :: Resource) resolveAttachmentRelation element terminal defaultAttachmentRelation = - if terminal == DIA.Flag.ConnectionPoint then + if isSubrelationOf terminal DIA.Flag.ConnectionPoint then (Nothing, flagTypeToAttachmentRelation element) else match possibleObject terminal MOD.DiagramConnectionRelationToConnectionRelation with