From 1c49f7f47fb4f3d9883e3f1a3ce116ed0aa2431b Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 8 Feb 2022 15:57:02 -0500 Subject: [PATCH] Tweak dash pattern to be less sparse --- piker/ui/_curve.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/piker/ui/_curve.py b/piker/ui/_curve.py index 78fdbad1..01b57c30 100644 --- a/piker/ui/_curve.py +++ b/piker/ui/_curve.py @@ -130,8 +130,10 @@ class FastAppendCurve(pg.PlotCurveItem): # all history of curve is drawn in single px thickness pen = pg.mkPen(hcolor(color)) pen.setStyle(_line_styles[style]) + if 'dash' in style: - pen.setDashPattern([6, 6]) + pen.setDashPattern([8, 3]) + self.setPen(pen) # last segment is drawn in 2px thickness for emphasis @@ -287,6 +289,7 @@ class FastAppendCurve(pg.PlotCurveItem): x_last + 0.5, y_last ) else: + # print((x[-1], y_last)) self._last_line = QLineF( x[-2], y[-2], x[-1], y_last @@ -337,6 +340,7 @@ class FastAppendCurve(pg.PlotCurveItem): p: QtGui.QPainter, opt: QtWidgets.QStyleOptionGraphicsItem, w: QtWidgets.QWidget + ) -> None: profiler = pg.debug.Profiler(disabled=not pg_profile_enabled()) @@ -354,11 +358,11 @@ class FastAppendCurve(pg.PlotCurveItem): # p.drawPath(self.path) # profiler('.drawPath()') - # else: p.setPen(self.last_step_pen) p.drawLine(self._last_line) profiler('.drawLine()') + # else: p.setPen(self.opts['pen']) p.drawPath(self.path) profiler('.drawPath()')