頂點粗細:self.P_ROUND: 圓形
def drawVertex(self, path, i):
d = self.point_size / self.scale
shape = self.point_type
point = self.points[i]
if i == self._highlightIndex:
size, shape = self._highlightSettings[self._highlightMode]
d *= size
if self._highlightIndex is not None:
self._vertex_fill_color = self.hvertex_fill_color
else:
self._vertex_fill_color = self.vertex_fill_color
if shape == self.P_SQUARE:
path.addRect(point.x() - d / 2, point.y() - d / 2, d, d)
elif shape == self.P_ROUND:
path.addEllipse(point, d / 3.0, d / 3.0)
線的粗細:0是很細,1中等
)
pen = QtGui.QPen(color)
# Try using integer sizes for smoother drawing(?)
pen_width=max(1, int(round(1.0 / self.scale)))
pen.setWidth(0)
painter.setPen(pen)
line_path = QtGui.QPainterPath()
#選中高亮蒙版
if self.fill:
color = self.select_fill_color if self.selected else self.fill_color
painter.fillPath(line_path, color)