git: 9front

Download patch

ref: d70ed5f41a4c253ac57d1e8aa3f75f125b133b55
parent: e615f0c4dc8ffb18a743b54da29ac2997129cfca
author: stanley lieber <stanley.lieber@gmail.com>
date: Mon Dec 30 19:52:52 EST 2013

mothra: mouse scrollwheel behave the same as in sam

--- a/sys/src/cmd/mothra/mothra.c
+++ b/sys/src/cmd/mothra/mothra.c
@@ -394,11 +394,11 @@
 			break;
 		case Emouse:
 			mouse=e.mouse;
-			if(mouse.buttons & (8|16)){
+			if(mouse.buttons & (8|16) && ptinrect(mouse.xy, text->r)){
 				if(mouse.buttons & 8)
-					scrolltext(-text->size.y/24, 1);
+					scrolltext(text->r.min.y - mouse.xy.y, 1);
 				else
-					scrolltext(text->size.y/24, 1);
+					scrolltext(mouse.xy.y - text->r.min.y, 1);
 				break;
 			}
 			plmouse(root, &mouse);
--