From 91fb451696b0c9d96121a723247c8b550616ca1c Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 26 Aug 2021 15:09:36 -0400 Subject: [PATCH] Fix marker-off-screen-placement for down arrows --- piker/ui/_annotate.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/piker/ui/_annotate.py b/piker/ui/_annotate.py index 748a3f49..6af8ffe7 100644 --- a/piker/ui/_annotate.py +++ b/piker/ui/_annotate.py @@ -172,11 +172,18 @@ class LevelMarker(QGraphicsPathItem): # _, marker_right, _ = marker_right_points(line._chart) x = self.scene_x() + if self.style == '>|': # short style, points "down-to" line + top_offset = self.h + bottom_offset = 0 + else: + top_offset = 0 + bottom_offset = self.h + if level > ymx: # pin to top of view self.setPos( QPointF( x, - self.h/3, + top_offset + self.h/3, ) ) @@ -185,7 +192,7 @@ class LevelMarker(QGraphicsPathItem): self.setPos( QPointF( x, - view.height() - 4/3*self.h, + view.height() - (bottom_offset + self.h/3), ) )