[dev] [st] [PATCH] Fix rectangular selection.

From: Colona <colona_AT_ycc.fr>
Date: Tue, 3 Jun 2014 05:11:45 +0200

selsort computes the wrong normalized coordinates when rectangular selection is
enabled, causing rectangular selection to only work when going toward either the
top left corner, or the bottom right one.
---
 st.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/st.c b/st.c
index 506be0f..c75d31b 100644
--- a/st.c
+++ b/st.c
_AT_@ -659,7 +659,7 @@ y2row(int y) {
 
 static void
 selsort(void) {
-	if(sel.ob.y == sel.oe.y) {
+	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 {
-- 
2.0.0
-- 
Ivan "Colona" Delalande
Received on Tue Jun 03 2014 - 05:11:45 CEST

This archive was generated by hypermail 2.3.0 : Tue Jun 03 2014 - 05:24:02 CEST