shithub: riscv

Download patch

ref: afccf58e8e174dec825412bc200c3c9af31bef3b
parent: 3864ccc42aa08dba37937b280f7d814a786c5b31
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Mon Aug 22 17:06:17 EDT 2022

audio/zuke: clip scrolling to the edges

--- a/sys/src/cmd/audio/zuke/zuke.c
+++ b/sys/src/cmd/audio/zuke/zuke.c
@@ -303,9 +303,6 @@
 	uvlong dur, msec;
 	char tmp[32];
 
-	updatescrollsz();
-	scroll = CLAMP(scroll, 0, pl->n - scrollsz);
-
 	lockdisplay(display);
 
 	if(back == nil || Dx(screen->r) != Dx(back->r) || Dy(screen->r) != Dy(back->r)){
@@ -1406,6 +1403,9 @@
 			else if(pcur > scroll + scrollsz)
 				scroll = pcur - scrollsz;
 		}
+
+		updatescrollsz();
+		scroll = CLAMP(scroll, 0, pl->n - scrollsz);
 
 		if(scroll != oscroll || pcur != oldpcur)
 			redraw(1);