Drop `SelectRect.mouse_drag_released()` since it was a dumb method

distribute_dis
Tyler Goodlet 2023-12-18 20:32:17 -05:00
parent 659649ec48
commit ab84303da7
2 changed files with 13 additions and 13 deletions

View File

@ -315,25 +315,15 @@ class SelectRect(QtWidgets.QGraphicsRectItem):
)
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:
self._label_proxy.setPos(
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(
self,
p1: QPointF,

View File

@ -763,6 +763,16 @@ class ChartView(ViewBox):
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 = self.childGroup.mapRectFromParent(ax)