summaryrefslogtreecommitdiff
path: root/sys/src/cmd/acme/scrl.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-08-05 00:25:40 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2013-08-05 00:25:40 +0200
commit1df707a0b2aaddb750fb707ae413dc67a19027a3 (patch)
tree1ced2c77d885e8c8f323c465c998d8083551d21a /sys/src/cmd/acme/scrl.c
parentcdc0b89d816aab6322e04f715019a7f8da2f2b75 (diff)
unsticky scrollbars
scrollbars used to put the mouse on the scrollbar while scrolling. if latency is high, this often results to the cursor jumping back. instead, make button 2 srolling work without needing the mouse to be inside the scrollbar and leave the mouse position alone.
Diffstat (limited to 'sys/src/cmd/acme/scrl.c')
-rw-r--r--sys/src/cmd/acme/scrl.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/sys/src/cmd/acme/scrl.c b/sys/src/cmd/acme/scrl.c
index 757974067..1310bc763 100644
--- a/sys/src/cmd/acme/scrl.c
+++ b/sys/src/cmd/acme/scrl.c
@@ -108,11 +108,10 @@ textscroll(Text *t, int but)
{
uint p0, oldp0;
Rectangle s;
- int x, y, my, h, first;
+ int y, my, h, first;
s = insetrect(t->scrollr, 1);
h = s.max.y-s.min.y;
- x = (s.min.x+s.max.x)/2;
oldp0 = ~0;
first = TRUE;
do{
@@ -122,10 +121,6 @@ textscroll(Text *t, int but)
my = s.min.y;
if(my >= s.max.y)
my = s.max.y;
- if(!eqpt(mouse->xy, Pt(x, my))){
- moveto(mousectl, Pt(x, my));
- readmouse(mousectl); /* absorb event generated by moveto() */
- }
if(but == 2){
y = my;
p0 = (vlong)t->file->nc*(y-s.min.y)/h;