ttake BORDER into account for selection. (thx Petr Sabata) - st - [fork] customized build of st, the simple terminal
(HTM) git clone git://src.adamsgaard.dk/st
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 89c8a3a2d9735fe10bcd85b90c8405fa20b4199e
(DIR) parent 9b63dd9f435408caf3f91b4dfa9144a611302dd6
(HTM) Author: Aurélien Aptel <aurelien.aptel@gmail.com>
Date: Sun, 3 Apr 2011 21:03:48 +0200
ttake BORDER into account for selection. (thx Petr Sabata)
Diffstat:
M st.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
(DIR) diff --git a/st.c b/st.c
t@@ -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;
t@@ -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