Drop `SelectRect.mouse_drag_released()` since it was a dumb method
parent
659649ec48
commit
ab84303da7
|
@ -315,25 +315,15 @@ class SelectRect(QtWidgets.QGraphicsRectItem):
|
||||||
)
|
)
|
||||||
|
|
||||||
def update_on_resize(self, vr, r):
|
def update_on_resize(self, vr, r):
|
||||||
"""Re-position measure label on view range change.
|
'''
|
||||||
|
Re-position measure label on view range change.
|
||||||
|
|
||||||
"""
|
'''
|
||||||
if self._abs_top_right:
|
if self._abs_top_right:
|
||||||
self._label_proxy.setPos(
|
self._label_proxy.setPos(
|
||||||
self.vb.mapFromView(self._abs_top_right)
|
self.vb.mapFromView(self._abs_top_right)
|
||||||
)
|
)
|
||||||
|
|
||||||
def mouse_drag_released(
|
|
||||||
self,
|
|
||||||
p1: QPointF,
|
|
||||||
p2: QPointF
|
|
||||||
) -> None:
|
|
||||||
"""Called on final button release for mouse drag with start and
|
|
||||||
end positions.
|
|
||||||
|
|
||||||
"""
|
|
||||||
self.set_pos(p1, p2)
|
|
||||||
|
|
||||||
def set_pos(
|
def set_pos(
|
||||||
self,
|
self,
|
||||||
p1: QPointF,
|
p1: QPointF,
|
||||||
|
|
|
@ -763,6 +763,16 @@ class ChartView(ViewBox):
|
||||||
|
|
||||||
self.select_box.mouse_drag_released(down_pos, pos)
|
self.select_box.mouse_drag_released(down_pos, pos)
|
||||||
|
|
||||||
|
# NOTE: think of this as a `.mouse_drag_release()`
|
||||||
|
# (bc HINT that's what i called the shit ass
|
||||||
|
# method that wrapped this call [yes, as a single
|
||||||
|
# fucking call] originally.. you bish, guille)
|
||||||
|
# Bo.. oraleeee
|
||||||
|
self.select_box.set_pos(
|
||||||
|
down_pos,
|
||||||
|
pos,
|
||||||
|
)
|
||||||
|
|
||||||
ax = QtCore.QRectF(down_pos, pos)
|
ax = QtCore.QRectF(down_pos, pos)
|
||||||
ax = self.childGroup.mapRectFromParent(ax)
|
ax = self.childGroup.mapRectFromParent(ax)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue