[hackers] [st] selnormalize: make special case explicit || noname
commit 22571ea4e8729efee6940b704666566b46e42e76
Author: noname <noname_AT_inventati.org>
Date: Thu Apr 30 19:59:24 2015 +0000
selnormalize: make special case explicit
Special case is when regular selection spans multiple lines.
Otherwise, just sort sel.ob.x and sel.ob.y.
diff --git a/st.c b/st.c
index 789e795..6138817 100644
--- a/st.c
+++ b/st.c
_AT_@ -685,12 +685,12 @@ void
selnormalize(void) {
int i;
- if(sel.ob.y == sel.oe.y || sel.type == SEL_RECTANGULAR) {
- sel.nb.x = MIN(sel.ob.x, sel.oe.x);
- sel.ne.x = MAX(sel.ob.x, sel.oe.x);
- } else {
+ if(sel.type == SEL_REGULAR && sel.ob.y != sel.oe.y) {
sel.nb.x = sel.ob.y < sel.oe.y ? sel.ob.x : sel.oe.x;
sel.ne.x = sel.ob.y < sel.oe.y ? sel.oe.x : sel.ob.x;
+ } else {
+ sel.nb.x = MIN(sel.ob.x, sel.oe.x);
+ sel.ne.x = MAX(sel.ob.x, sel.oe.x);
}
sel.nb.y = MIN(sel.ob.y, sel.oe.y);
sel.ne.y = MAX(sel.ob.y, sel.oe.y);
Received on Mon May 04 2015 - 14:23:30 CEST
This archive was generated by hypermail 2.3.0
: Mon May 04 2015 - 14:24:15 CEST