[hackers] [st] take BORDER into account for selection. (thx Petr Sabata) || Aurélien Aptel

From: <hg_AT_suckless.org>
Date: Sun, 3 Apr 2011 19:06:14 +0000 (UTC)

changeset: 186:df06ae9f82dd
user: Aurélien Aptel <aurelien.aptel_AT_gmail.com>
date: Sun Apr 03 21:03:48 2011 +0200
files: st.c
description:
take BORDER into account for selection. (thx Petr Sabata)

diff -r bf0cf089a9ae -r df06ae9f82dd st.c
--- a/st.c Sun Apr 03 21:00:55 2011 +0200
+++ b/st.c Sun Apr 03 21:03:48 2011 +0200
@@ -392,8 +392,8 @@
         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 @@
 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
Received on Sun Apr 03 2011 - 21:06:14 CEST

This archive was generated by hypermail 2.2.0 : Sun Apr 03 2011 - 21:12:06 CEST