From ab84303da7e089a78210b5b043a2761f73393b44 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 18 Dec 2023 20:32:17 -0500 Subject: [PATCH] Drop `SelectRect.mouse_drag_released()` since it was a dumb method --- piker/ui/_editors.py | 16 +++------------- piker/ui/_interaction.py | 10 ++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/piker/ui/_editors.py b/piker/ui/_editors.py index 4e489f0f..96c1795f 100644 --- a/piker/ui/_editors.py +++ b/piker/ui/_editors.py @@ -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, diff --git a/piker/ui/_interaction.py b/piker/ui/_interaction.py index e1df4066..3a21e6f4 100644 --- a/piker/ui/_interaction.py +++ b/piker/ui/_interaction.py @@ -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)