Skip to content

Commit

Permalink
fix: Restore vertical clim dragging
Browse files Browse the repository at this point in the history
  • Loading branch information
gselzer committed Nov 15, 2024
1 parent 5b23fe8 commit 71edf3c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/ndv/histogram/views/_vispy.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,12 +673,19 @@ def _find_nearby_node(
gamma_to_plot = self._handle_transform.map

Check warning on line 673 in src/ndv/histogram/views/_vispy.py

View check run for this annotation

Codecov / codecov/patch

src/ndv/histogram/views/_vispy.py#L672-L673

Added lines #L672 - L673 were not covered by tests

if self._clims is not None:
if self._vertical:
click = click_y
right = plot_to_canvas([0, self._clims[1]])[1]
left = plot_to_canvas([0, self._clims[0]])[1]

Check warning on line 679 in src/ndv/histogram/views/_vispy.py

View check run for this annotation

Codecov / codecov/patch

src/ndv/histogram/views/_vispy.py#L675-L679

Added lines #L675 - L679 were not covered by tests
else:
click = click_x
right = plot_to_canvas([self._clims[1], 0])[0]
left = plot_to_canvas([self._clims[0], 0])[0]

Check warning on line 683 in src/ndv/histogram/views/_vispy.py

View check run for this annotation

Codecov / codecov/patch

src/ndv/histogram/views/_vispy.py#L681-L683

Added lines #L681 - L683 were not covered by tests

# Right bound always selected on overlap
right = plot_to_canvas([self._clims[1]])[0]
if bool(abs(right - click_x) < tolerance):
if bool(abs(right - click) < tolerance):
return Grabbable.RIGHT_CLIM
left = plot_to_canvas([self._clims[0]])[0]
if bool(abs(left - click_x) < tolerance):
if bool(abs(left - click) < tolerance):
return Grabbable.LEFT_CLIM

Check warning on line 689 in src/ndv/histogram/views/_vispy.py

View check run for this annotation

Codecov / codecov/patch

src/ndv/histogram/views/_vispy.py#L686-L689

Added lines #L686 - L689 were not covered by tests

if self._gamma_handle_pos is not None:
Expand Down

0 comments on commit 71edf3c

Please sign in to comment.