diff --git a/typetapper/hierarchy_graph.py b/typetapper/hierarchy_graph.py index df3dfea..cd53ba1 100644 --- a/typetapper/hierarchy_graph.py +++ b/typetapper/hierarchy_graph.py @@ -139,10 +139,11 @@ class HierarchicalGraph(RelativeAtomGraph): def _add_node(self, relatom: RelativeAtom, path: OpSequence, has_gone_down: bool) -> bool: res = super()._add_node(relatom, path, has_gone_down) - if res: + if relatom not in self.__graph.nodes: self._atom_parents[relatom] = self._current_group self._current_group.children.add(relatom) self.__graph.add_node(relatom) + if res: self._prop_propagate(relatom, True) self.check_invariants() return res diff --git a/typetapper/hierarchy_graph_view.py b/typetapper/hierarchy_graph_view.py index 0891e17..48c28c1 100644 --- a/typetapper/hierarchy_graph_view.py +++ b/typetapper/hierarchy_graph_view.py @@ -671,7 +671,7 @@ class HierarchicalGraphWidget(QZoomableDraggableGraphicsView): def mousePressEvent(self, event): self._mouse_is_down = True - if event.modifiers() & Qt.ShiftModifier == 0: + if (event.modifiers() & Qt.ShiftModifier) == Qt.NoModifier: self.setDragMode(QZoomableDraggableGraphicsView.ScrollHandDrag) else: self.setDragMode(QZoomableDraggableGraphicsView.RubberBandDrag) @@ -781,7 +781,7 @@ class HGNode(AnimatableItem): def exit(self, duration=250): self.exiting = True - for edge in self.edges.values(): + for edge in list(self.edges.values()): edge.orient(self, away=True) edge.exit(duration) edge.start.edges.pop(self.model, None) diff --git a/typetapper/relative_graph.py b/typetapper/relative_graph.py index cb57ad7..6ee238e 100644 --- a/typetapper/relative_graph.py +++ b/typetapper/relative_graph.py @@ -57,7 +57,6 @@ class RelativeAtomGraph: If relatom is not present in the graph, add it. If it is present in the graph, merge the new information into its attrs """ - from .data import RegisterAtom newattrs = RelativeAtomAttrs( prop=self.kp.graph.nodes[relatom.atom].get('prop', Prop()).transform(path.invert()), path=path, @@ -116,9 +115,6 @@ class RelativeAtomGraph: edge_ops: OpSequence, is_pred: bool, ) -> Optional[RelativeAtom]: - #if str(relatom.atom) == 'rsp @ 0x4144a8' and str(succ) == 'MEM @ 0x4144d9': - # import ipdb; ipdb.set_trace() - weh = self._update_callstack(relatom.callstack, relatom.rcallstack, edge_cf, is_pred) if weh is None: return None