shithub: orca

Download patch

ref: 3ac9653205ad8080a36638f6d27a82757bec16cc
parent: 729ec5d987506fbf4a76ff0cb168728d3dd13490
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Wed Feb 19 05:58:29 EST 2020

plan9: draw just one arrow on each side

--- a/plan9.c
+++ b/plan9.c
@@ -577,31 +577,25 @@
 	draw(screen, r, color[Dback], nil, ZP);
 
 	p = top;
-	p.y -= glyphsz.y/2;
-	for (i = 0; i < 3; i++) {
-		if (scroll.x > 0) {
-			p.x = top.x - Txtoff;
-			string(screen, p, color[Dfmed], ZP, font, "←");
-		}
-		if (max.x+scroll.x < field.width) {
-			p.x = top.x + max.x*glyphsz.x + Txtoff - glyphsz.x;
-			string(screen, p, color[Dfmed], ZP, font, "→");
-		}
-		p.y += glyphsz.y*max.y/2;
+	p.y += glyphsz.y*(max.y-1)/2;
+	if (scroll.x > 0) {
+		p.x = top.x - Txtoff;
+		string(screen, p, color[Dfmed], ZP, font, "←");
 	}
+	if (max.x+scroll.x < field.width) {
+		p.x = top.x + max.x*glyphsz.x + Txtoff - glyphsz.x;
+		string(screen, p, color[Dfmed], ZP, font, "→");
+	}
 
 	p = top;
-	p.x -= glyphsz.x/2;
-	for (i = 0; i < 3; i++) {
-		if (scroll.y > 0) {
-			p.y = screen->r.min.y;
-			string(screen, p, color[Dfmed], ZP, font, "↑");
-		}
-		if (max.y+scroll.y < field.height) {
-			p.y = top.y + max.y*glyphsz.y;
-			string(screen, p, color[Dfmed], ZP, font, "↓");
-		}
-		p.x += glyphsz.x*max.x/2;
+	p.x += glyphsz.x*(max.x-1)/2;
+	if (scroll.y > 0) {
+		p.y = screen->r.min.y;
+		string(screen, p, color[Dfmed], ZP, font, "↑");
+	}
+	if (max.y+scroll.y < field.height) {
+		p.y = top.y + max.y*glyphsz.y;
+		string(screen, p, color[Dfmed], ZP, font, "↓");
 	}
 
 	i = 0;