Xinqi Bao's Git

Fix rectangular selection.
authorColona <[email protected]>
Wed, 4 Jun 2014 04:47:55 +0000 (21:47 -0700)
committerRoberto E. Vargas Caballero <[email protected]>
Wed, 4 Jun 2014 19:10:25 +0000 (21:10 +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.

Signed-off-by: Roberto E. Vargas Caballero <[email protected]>
st.c

diff --git a/st.c b/st.c
index 2e55963..8b65450 100644 (file)
--- a/st.c
+++ b/st.c
@@ -670,7 +670,7 @@ static void
 selnormalize(void) {
        int i;
 
-       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 {