aboutsummarylogtreecommitdiffstats
path: root/st.c
diff options
context:
space:
mode:
authorAurélien Aptel2011-04-03 21:03:48 +0200
committerAurélien Aptel2011-04-03 21:03:48 +0200
commit1e1a1aad85d127e4eefcd86b7cbf27167ad7cec9 (patch)
treeba65dcbcc2f3ca5dafe2f940358aa1fd3fd62109 /st.c
parentf137a4313bffd34fdcc15f1b79936aab5d7f436b (diff)
downloadaur-1e1a1aad85d127e4eefcd86b7cbf27167ad7cec9.tar.gz
take BORDER into account for selection. (thx Petr Sabata)
Diffstat (limited to 'st.c')
-rw-r--r--st.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/st.c b/st.c
index d0f2f5e6f1df..a6fb7668355c 100644
--- a/st.c
+++ b/st.c
@@ -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