mirror of https://gitlab.com/pamhyr/pamhyr2
Network: Fix pep8.
parent
f62b209ffb
commit
c7001bf0fa
|
|
@ -157,7 +157,7 @@ class EdgeItem(QGraphicsItem):
|
|||
def boundingRect(self):
|
||||
# Rectangle of edge for display update
|
||||
pen_width = 2.0
|
||||
extra = 0 #(pen_width + 5) / 2.0
|
||||
extra = 0 # (pen_width + 5) / 2.0
|
||||
|
||||
return self._bound_rect.normalized().adjusted(
|
||||
-extra, -extra, extra, extra
|
||||
|
|
@ -167,7 +167,7 @@ class EdgeItem(QGraphicsItem):
|
|||
return self._arc
|
||||
|
||||
def paint(self, painter, option, widget):
|
||||
#self.paint_line(painter, option, widget)
|
||||
# self.paint_line(painter, option, widget)
|
||||
self.paint_arc(painter, option, widget)
|
||||
|
||||
@timer
|
||||
|
|
@ -289,7 +289,7 @@ class EdgeItem(QGraphicsItem):
|
|||
bisector_ab = QLineF(line_ab.pointAt(0.5), line_ab.p2())
|
||||
bisector_ab.setAngle(line_ab.normalVector().angle())
|
||||
|
||||
center = QPointF(0,0)
|
||||
center = QPointF(0, 0)
|
||||
bisector_ab.intersect(bisector_bc, center)
|
||||
|
||||
circle = QRectF(
|
||||
|
|
@ -339,7 +339,7 @@ class EdgeItem(QGraphicsItem):
|
|||
return p3
|
||||
|
||||
def paint_arrow(self, painter, option, widget,
|
||||
color, center, angle):
|
||||
color, center, angle):
|
||||
brush = QBrush()
|
||||
brush.setColor(color)
|
||||
brush.setStyle(Qt.SolidPattern)
|
||||
|
|
@ -360,6 +360,7 @@ class EdgeItem(QGraphicsItem):
|
|||
painter.drawPolygon(poly)
|
||||
painter.fillPath(path, brush)
|
||||
|
||||
|
||||
class NodeText(QGraphicsTextItem):
|
||||
def __init__(self, node_item):
|
||||
super(NodeText, self).__init__()
|
||||
|
|
@ -520,12 +521,12 @@ class GraphWidget(QGraphicsView):
|
|||
)
|
||||
|
||||
# Multiple edges counter
|
||||
if (n1,n2) not in multiple_edges:
|
||||
if (n1, n2) not in multiple_edges:
|
||||
ind = 1
|
||||
else:
|
||||
ind = multiple_edges[(n1,n2)] + 1
|
||||
ind = multiple_edges[(n1, n2)] + 1
|
||||
|
||||
multiple_edges[(n1,n2)] = ind
|
||||
multiple_edges[(n1, n2)] = ind
|
||||
|
||||
iedge = EdgeItem(n1, n2, edge, self)
|
||||
iedge._ind = ind
|
||||
|
|
|
|||
Loading…
Reference in New Issue