diff --git a/zxlive/proof_panel.py b/zxlive/proof_panel.py index 7447883..28b960a 100644 --- a/zxlive/proof_panel.py +++ b/zxlive/proof_panel.py @@ -363,10 +363,11 @@ def snap_vector(v: QVector2D) -> None: avg_left = -avg_right dist = 0.25 if QVector2D.dotProduct(avg_left, avg_right) != 0 else 0.35 - # Put the phase on the left hand side if the mouse direction is further - # away from the average direction of the left neighbours than the right. + # Put the phase on the left hand side if the mouse direction is closer + # to the average direction of the left neighbours than the right, i.e., + # associate the phase to the larger sliced area. phase_left = QVector2D.dotProduct(QVector2D(mouse_dir), avg_left) \ - <= QVector2D.dotProduct(QVector2D(mouse_dir), avg_right) + >= QVector2D.dotProduct(QVector2D(mouse_dir), avg_right) new_g = copy.deepcopy(self.graph) left_vert = new_g.add_vertex(self.graph.type(v),