diff options
author | Petter Rodhelind <petter.rodhelind@gmail.com> | 2017-10-30 15:10:57 +0100 |
---|---|---|
committer | Petter Rodhelind <petter.rodhelind@gmail.com> | 2017-10-30 15:10:57 +0100 |
commit | f25f90ea3332df18129558fd246f7b5d4c80b4d8 (patch) | |
tree | fdc08d15332a597e492b9b1d4058578a43993675 /src/cmd/samterm | |
parent | 911dcfd317786043c1f3d406207d4aba50891970 (diff) | |
download | plan9port-f25f90ea3332df18129558fd246f7b5d4c80b4d8.tar.gz plan9port-f25f90ea3332df18129558fd246f7b5d4c80b4d8.tar.bz2 plan9port-f25f90ea3332df18129558fd246f7b5d4c80b4d8.zip |
samterm: Mouse scroll one line at a time.
Diffstat (limited to 'src/cmd/samterm')
-rw-r--r-- | src/cmd/samterm/scroll.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/samterm/scroll.c b/src/cmd/samterm/scroll.c index dd44bc3d..36173410 100644 --- a/src/cmd/samterm/scroll.c +++ b/src/cmd/samterm/scroll.c @@ -156,6 +156,8 @@ scroll(Flayer *l, int but) p0 = 0; if(but == 1 || but == 4) { p0 = (long)(my-s.min.y)/l->f.font->height+1; + if(but == 4) + p0 = (long)2; but = 1; }else if(but == 2){ if(tot > 1024L*1024L) @@ -164,6 +166,8 @@ scroll(Flayer *l, int but) p0 = tot*(y-s.min.y)/h; }else if(but == 3 || but == 5){ p0 = l->origin+frcharofpt(&l->f, Pt(s.max.x, my)); + if(but == 5) + p0 = l->origin+frcharofpt(&l->f, Pt(s.max.x, s.min.y+l->f.font->height+1)); if(p0 > tot) p0 = tot; but = 3; |