Browse Source

Add cases so selection from right, left in all orientations works

tb-init-ui-render
Taylor Bockman 5 years ago
parent
commit
b0949f6827
  1. 15
      clusterview/opengl_widget.py

15
clusterview/opengl_widget.py

@ -261,6 +261,21 @@ def box_hit(tx, ty, x1, y1, x2, y2):
ty <= y1 and
ty >= y2)
# The box in this case started from the top right
if x1 > x2 and y1 < y2:
return (tx <= x1 and
tx >= x2 and
ty >= y1 and
ty <= y2)
# The box in this case started from the bottom left
if x1 < x2 and y1 > y2:
return (tx >= x1 and
tx <= x2 and
ty <= y1 and
ty >= y2)
# Normal condition: Box starts from the top left
return (tx >= x1 and
tx <= x2 and
ty >= y1 and

Loading…
Cancel
Save