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 | 89c8a3a2d9735fe10bcd85b90c8405fa20b4199e (patch) | |
| tree | a7319262e36281bac62ee3fbefb65a5dfce74beb | |
| parent | 9b63dd9f435408caf3f91b4dfa9144a611302dd6 (diff) | |
| download | st-89c8a3a2d9735fe10bcd85b90c8405fa20b4199e.tar.gz st-89c8a3a2d9735fe10bcd85b90c8405fa20b4199e.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 |
