aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Lohmann <20h@r-36.net>2013-03-20 21:19:28 +0100
committerChristoph Lohmann <20h@r-36.net>2013-03-20 21:19:28 +0100
commit4b17dddb104bd2ac87dd6e334aafd325197c1407 (patch)
tree9b281e44eb99184afe8462b468d81ded4c0d9202
parent55adf0aad1d5acf0b9a00e2a9f834cef8b61b3b3 (diff)
downloadst-patched-4b17dddb104bd2ac87dd6e334aafd325197c1407.tar.bz2
st-patched-4b17dddb104bd2ac87dd6e334aafd325197c1407.tar.xz
st-patched-4b17dddb104bd2ac87dd6e334aafd325197c1407.zip
Making rectangular selection work again.
People sending me patches against strange revisions and basing on their own revisions make me having to reapply them. Then such errors appear. Thanks Alexander Sedov <alex0player@gmail.com> for noticing this.
-rw-r--r--st.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/st.c b/st.c
index 0923cec..131cba8 100644
--- a/st.c
+++ b/st.c
@@ -649,13 +649,10 @@ selected(int x, int y) {
649 if(sel.ey == y && sel.by == y) { 649 if(sel.ey == y && sel.by == y) {
650 bx = MIN(sel.bx, sel.ex); 650 bx = MIN(sel.bx, sel.ex);
651 ex = MAX(sel.bx, sel.ex); 651 ex = MAX(sel.bx, sel.ex);
652
652 return BETWEEN(x, bx, ex); 653 return BETWEEN(x, bx, ex);
653 } 654 }
654 655
655 return ((sel.b.y < y && y < sel.e.y)
656 || (y == sel.e.y && x <= sel.e.x))
657 || (y == sel.b.y && x >= sel.b.x
658 && (x <= sel.e.x || sel.b.y != sel.e.y));
659 switch(sel.type) { 656 switch(sel.type) {
660 case SEL_REGULAR: 657 case SEL_REGULAR:
661 return ((sel.b.y < y && y < sel.e.y) 658 return ((sel.b.y < y && y < sel.e.y)