diff options
author | Aurélien Aptel <aurelien.aptel@gmail.com> | 2011-04-03 21:03:48 +0200 |
---|---|---|
committer | Aurélien Aptel <aurelien.aptel@gmail.com> | 2011-04-03 21:03:48 +0200 |
commit | 55c8d82eb17a3df0d132e403f7f049e6d68be48b (patch) | |
tree | a7319262e36281bac62ee3fbefb65a5dfce74beb /st.c | |
parent | d679267c46938c8d8e1c8eeff2375ebe487fd963 (diff) | |
download | st-55c8d82eb17a3df0d132e403f7f049e6d68be48b.tar.gz st-55c8d82eb17a3df0d132e403f7f049e6d68be48b.tar.bz2 |
take BORDER into account for selection. (thx Petr Sabata)
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -392,8 +392,8 @@ getbuttoninfo(XEvent *e, int *b, int *x, int *y) { if(b) *b = e->xbutton.button; - *x = e->xbutton.x/xw.cw; - *y = e->xbutton.y/xw.ch; + *x = (e->xbutton.x - BORDER)/xw.cw; + *y = (e->xbutton.y - BORDER)/xw.ch; sel.b.x = sel.by < sel.ey ? sel.bx : sel.ex; sel.b.y = MIN(sel.by, sel.ey); sel.e.x = sel.by < sel.ey ? sel.ex : sel.bx; @@ -403,8 +403,8 @@ getbuttoninfo(XEvent *e, int *b, int *x, int *y) { void bpress(XEvent *e) { sel.mode = 1; - sel.ex = sel.bx = e->xbutton.x/xw.cw; - sel.ey = sel.by = e->xbutton.y/xw.ch; + sel.ex = sel.bx = (e->xbutton.x - BORDER)/xw.cw; + sel.ey = sel.by = (e->xbutton.y - BORDER)/xw.ch; } void |