From 0f7642b3bd653687a880733e4673b450e3612c6c Mon Sep 17 00:00:00 2001 From: Jussi Koskela Date: Thu, 22 Aug 2019 14:20:01 +0300 Subject: [PATCH] Support subrelations of DIA.Flag.ConnectionPoint in Diagram.setElements gitlab #359 Change-Id: I070a1615057c7f17a55e43bdb975712201f3d710 --- bundles/org.simantics.modeling/scl/Simantics/Diagram.scl | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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 -- 2.43.2