shithub: riscv

Download patch

ref: 02d22e158d8deb898801e5221f84885cd99fbfed
parent: 18a50d04ac1587ad8119feffcc1fa9f7b9b90c6d
author: stanley lieber <[email protected]>
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);