@@ -142,29 +142,30 @@ def get_destination_settings_if_any(
142142 overlay_settings = None
143143 destination : Optional [str ]
144144
145- match action ["connectionType" ], action .get ("transitionNodeID" , None ):
146- case "BACK" , _:
147- destination = "back"
148- case "INTERNAL_NODE" , None :
145+ connection_type = action .get ("connectionType" )
146+ transition_node_id = action .get ("transitionNodeID" , None )
147+
148+ if connection_type == "BACK" :
149+ destination = "back"
150+ elif connection_type == "INTERNAL_NODE" and transition_node_id is None :
151+ destination = None
152+ elif connection_type == "INTERNAL_NODE" and transition_node_id is not None :
153+ if utils .is_invalid_ref (transition_node_id ):
149154 destination = None
150- case "INTERNAL_NODE" , transition_node_id :
151- if utils .is_invalid_ref (transition_node_id ):
152- destination = None
153- else :
154- destination = utils .gen_object_id (transition_node_id )
155- transition_node = context .fig_node (transition_node_id )
156-
157- if "overlayBackgroundInteraction" in transition_node :
158- offset = action .get ("overlayRelativePosition" , {"x" : 0 , "y" : 0 })
159-
160- overlay_settings = FlowOverlaySettings .Positioned (
161- transition_node .get ("overlayPositionType" , "CENTER" ),
162- Point .from_dict (offset ),
163- )
164-
165- case "NONE" , _:
166- destination = None
167- case _:
168- raise Fig2SketchWarning ("PRT004" )
155+ else :
156+ destination = utils .gen_object_id (transition_node_id )
157+ transition_node = context .fig_node (transition_node_id )
158+
159+ if "overlayBackgroundInteraction" in transition_node :
160+ offset = action .get ("overlayRelativePosition" , {"x" : 0 , "y" : 0 })
161+
162+ overlay_settings = FlowOverlaySettings .Positioned (
163+ transition_node .get ("overlayPositionType" , "CENTER" ),
164+ Point .from_dict (offset ),
165+ )
166+ elif connection_type == "NONE" :
167+ destination = None
168+ else :
169+ raise Fig2SketchWarning ("PRT004" )
169170
170171 return destination , overlay_settings
0 commit comments