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