mirror of https://gitlab.com/pamhyr/pamhyr2
Network: Reverse order for edges adding in scene to fix mouse selection.
parent
cd540b0146
commit
9c5ea0bdd9
|
|
@ -157,7 +157,7 @@ class EdgeItem(QGraphicsItem):
|
|||
def boundingRect(self):
|
||||
# Rectangle of edge for display update
|
||||
pen_width = 2.0
|
||||
extra = (pen_width + 5) / 2.0
|
||||
extra = 0 #(pen_width + 5) / 2.0
|
||||
|
||||
return self._bound_rect.normalized().adjusted(
|
||||
-extra, -extra, extra, extra
|
||||
|
|
@ -499,6 +499,7 @@ class GraphWidget(QGraphicsView):
|
|||
|
||||
curr_edge = self.graph.current_reach()
|
||||
|
||||
iedges = []
|
||||
multiple_edges = {}
|
||||
for edge in self.graph.edges():
|
||||
n1 = next(
|
||||
|
|
@ -529,6 +530,9 @@ class GraphWidget(QGraphicsView):
|
|||
if edge == curr_edge:
|
||||
self._current_edge = iedge
|
||||
|
||||
iedges.append(iedge)
|
||||
|
||||
for iedge in reversed(iedges):
|
||||
self.scene().addItem(iedge)
|
||||
self.edge_items.append(iedge)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue