Tweak dash pattern to be less sparse

windows_fixes_yo
Tyler Goodlet 2022-02-08 15:57:02 -05:00
parent ef04781a2b
commit 1c49f7f47f
1 changed files with 6 additions and 2 deletions

View File

@ -130,8 +130,10 @@ class FastAppendCurve(pg.PlotCurveItem):
# all history of curve is drawn in single px thickness # all history of curve is drawn in single px thickness
pen = pg.mkPen(hcolor(color)) pen = pg.mkPen(hcolor(color))
pen.setStyle(_line_styles[style]) pen.setStyle(_line_styles[style])
if 'dash' in style: if 'dash' in style:
pen.setDashPattern([6, 6]) pen.setDashPattern([8, 3])
self.setPen(pen) self.setPen(pen)
# last segment is drawn in 2px thickness for emphasis # last segment is drawn in 2px thickness for emphasis
@ -287,6 +289,7 @@ class FastAppendCurve(pg.PlotCurveItem):
x_last + 0.5, y_last x_last + 0.5, y_last
) )
else: else:
# print((x[-1], y_last))
self._last_line = QLineF( self._last_line = QLineF(
x[-2], y[-2], x[-2], y[-2],
x[-1], y_last x[-1], y_last
@ -337,6 +340,7 @@ class FastAppendCurve(pg.PlotCurveItem):
p: QtGui.QPainter, p: QtGui.QPainter,
opt: QtWidgets.QStyleOptionGraphicsItem, opt: QtWidgets.QStyleOptionGraphicsItem,
w: QtWidgets.QWidget w: QtWidgets.QWidget
) -> None: ) -> None:
profiler = pg.debug.Profiler(disabled=not pg_profile_enabled()) profiler = pg.debug.Profiler(disabled=not pg_profile_enabled())
@ -354,11 +358,11 @@ class FastAppendCurve(pg.PlotCurveItem):
# p.drawPath(self.path) # p.drawPath(self.path)
# profiler('.drawPath()') # profiler('.drawPath()')
# else:
p.setPen(self.last_step_pen) p.setPen(self.last_step_pen)
p.drawLine(self._last_line) p.drawLine(self._last_line)
profiler('.drawLine()') profiler('.drawLine()')
# else:
p.setPen(self.opts['pen']) p.setPen(self.opts['pen'])
p.drawPath(self.path) p.drawPath(self.path)
profiler('.drawPath()') profiler('.drawPath()')