shithub: zuke

Download patch

ref: c8357e7a68e4409caf36f96188f5aadfa45ec5bb
parent: c611a7b488e89d1ac3bd8698fff5580b5cea66c1
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Tue Mar 1 05:43:11 EST 2016

place the scroller correctly

--- a/zuke.c
+++ b/zuke.c
@@ -24,9 +24,8 @@
 	Seekbytes = Bps*10, /* 10 seconds */
 
 	Scrollwidth = 12,
+	Scrollheight = 16,
 
-	Maxfailures = 16,
-
 	Relbufsz = Bps/5, /* 0.2 second */
 };
 
@@ -109,9 +108,9 @@
 		if(scroll < 1)
 			scrollcenter = 0;
 		else
-			scrollcenter = (Dy(screen->r)-8)*scroll / plnum;
-		r.min.y += scrollcenter + 4;
-		r.max.y = r.min.y + 16;
+			scrollcenter = (Dy(screen->r)-Scrollheight/2)*scroll / plnum;
+		r.min.y += scrollcenter + Scrollheight/4;
+		r.max.y = r.min.y + Scrollheight;
 		draw(screen, r, colb, nil, ZP);
 
 		left += Scrollwidth + 4;
@@ -717,7 +716,7 @@
 				if(scrollsz >= plnum)
 					break;
 				if(usingscrollbar)
-					scroll = (m.xy.y - screen->r.min.y)*plnum / (Dy(screen->r)-8);
+					scroll = (m.xy.y - screen->r.min.y - Scrollheight/4)*plnum / (Dy(screen->r)-Scrollheight/2);
 				else
 					scroll = oldscroll + (lastclick.y - m.xy.y) / f->height;
 				if(scroll < 0)