mirror of
https://github.com/alrayyes/st.git
synced 2024-11-29 14:06:21 +00:00
take BORDER into account for selection. (thx Petr Sabata)
This commit is contained in:
parent
9b63dd9f43
commit
89c8a3a2d9
1 changed files with 4 additions and 4 deletions
8
st.c
8
st.c
|
@ -392,8 +392,8 @@ getbuttoninfo(XEvent *e, int *b, int *x, int *y) {
|
||||||
if(b)
|
if(b)
|
||||||
*b = e->xbutton.button;
|
*b = e->xbutton.button;
|
||||||
|
|
||||||
*x = e->xbutton.x/xw.cw;
|
*x = (e->xbutton.x - BORDER)/xw.cw;
|
||||||
*y = e->xbutton.y/xw.ch;
|
*y = (e->xbutton.y - BORDER)/xw.ch;
|
||||||
sel.b.x = sel.by < sel.ey ? sel.bx : sel.ex;
|
sel.b.x = sel.by < sel.ey ? sel.bx : sel.ex;
|
||||||
sel.b.y = MIN(sel.by, sel.ey);
|
sel.b.y = MIN(sel.by, sel.ey);
|
||||||
sel.e.x = sel.by < sel.ey ? sel.ex : sel.bx;
|
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
|
void
|
||||||
bpress(XEvent *e) {
|
bpress(XEvent *e) {
|
||||||
sel.mode = 1;
|
sel.mode = 1;
|
||||||
sel.ex = sel.bx = e->xbutton.x/xw.cw;
|
sel.ex = sel.bx = (e->xbutton.x - BORDER)/xw.cw;
|
||||||
sel.ey = sel.by = e->xbutton.y/xw.ch;
|
sel.ey = sel.by = (e->xbutton.y - BORDER)/xw.ch;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue