Attempt px perfection on crosshair lines placement
parent
f51e503e47
commit
bf78c13df4
|
@ -129,6 +129,7 @@ _corner_margins = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# TODO: change this into a ``pg.TextItem``...
|
||||||
class ContentsLabel(pg.LabelItem):
|
class ContentsLabel(pg.LabelItem):
|
||||||
"""Label anchored to a ``ViewBox`` typically for displaying
|
"""Label anchored to a ``ViewBox`` typically for displaying
|
||||||
datum-wise points from the "viewed" contents.
|
datum-wise points from the "viewed" contents.
|
||||||
|
@ -376,7 +377,7 @@ class Cursor(pg.GraphicsObject):
|
||||||
self.graphics[plot]['hl'].setY(iy + line_offset)
|
self.graphics[plot]['hl'].setY(iy + line_offset)
|
||||||
|
|
||||||
self.graphics[self.active_plot]['yl'].update_label(
|
self.graphics[self.active_plot]['yl'].update_label(
|
||||||
abs_pos=plot.mapFromView(QPointF(ix, iy)),
|
abs_pos=plot.mapFromView(QPointF(ix, iy + line_offset)),
|
||||||
value=iy
|
value=iy
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -406,7 +407,7 @@ class Cursor(pg.GraphicsObject):
|
||||||
# otherwise gobbles tons of CPU..
|
# otherwise gobbles tons of CPU..
|
||||||
|
|
||||||
# map back to abs (label-local) coordinates
|
# map back to abs (label-local) coordinates
|
||||||
abs_pos=plot.mapFromView(QPointF(ix, iy)),
|
abs_pos=plot.mapFromView(QPointF(ix + line_offset, iy)),
|
||||||
value=ix,
|
value=ix,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue