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 | |
parent | d679267c46938c8d8e1c8eeff2375ebe487fd963 (diff) | |
download | st-patched-55c8d82eb17a3df0d132e403f7f049e6d68be48b.tar.bz2 st-patched-55c8d82eb17a3df0d132e403f7f049e6d68be48b.tar.xz st-patched-55c8d82eb17a3df0d132e403f7f049e6d68be48b.zip |
take BORDER into account for selection. (thx Petr Sabata)
-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) { | |||
392 | if(b) | 392 | if(b) |
393 | *b = e->xbutton.button; | 393 | *b = e->xbutton.button; |
394 | 394 | ||
395 | *x = e->xbutton.x/xw.cw; | 395 | *x = (e->xbutton.x - BORDER)/xw.cw; |
396 | *y = e->xbutton.y/xw.ch; | 396 | *y = (e->xbutton.y - BORDER)/xw.ch; |
397 | sel.b.x = sel.by < sel.ey ? sel.bx : sel.ex; | 397 | sel.b.x = sel.by < sel.ey ? sel.bx : sel.ex; |
398 | sel.b.y = MIN(sel.by, sel.ey); | 398 | sel.b.y = MIN(sel.by, sel.ey); |
399 | sel.e.x = sel.by < sel.ey ? sel.ex : sel.bx; | 399 | sel.e.x = sel.by < sel.ey ? sel.ex : sel.bx; |
@@ -403,8 +403,8 @@ getbuttoninfo(XEvent *e, int *b, int *x, int *y) { | |||
403 | void | 403 | void |
404 | bpress(XEvent *e) { | 404 | bpress(XEvent *e) { |
405 | sel.mode = 1; | 405 | sel.mode = 1; |
406 | sel.ex = sel.bx = e->xbutton.x/xw.cw; | 406 | sel.ex = sel.bx = (e->xbutton.x - BORDER)/xw.cw; |
407 | sel.ey = sel.by = e->xbutton.y/xw.ch; | 407 | sel.ey = sel.by = (e->xbutton.y - BORDER)/xw.ch; |
408 | } | 408 | } |
409 | 409 | ||
410 | void | 410 | void |