From 4183fbdc44fd34473e0d99e2ac3034340f06763e Mon Sep 17 00:00:00 2001
From: "Philip J. Freeman" <elektron@halo.nu>
Date: Wed, 11 Apr 2018 12:54:53 -0700
Subject: logo: fix an edge case where logo is drawn forever

height = 2560 /3 = 853

while ( height -= 2) { // never hits 0
	...
}
---
 src/logo.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/logo.c b/src/logo.c
index c853db9..65c890b 100644
--- a/src/logo.c
+++ b/src/logo.c
@@ -43,7 +43,7 @@ void vwm_draw_logo(vwm_t *vwm)
 	height /= 3;
 
 	/* the logo gets shrunken vertically until it's essentially a flat line */
-	while (height -= 2) {
+	while (height > 0 && width > 0) {
 		/* scale and center the points to the screen size */
 		for (i = 0; i < VWM_LOGO_POINTS; i++) {
 			points[i].x = xoff + (i * .2 * (float)width);
@@ -60,6 +60,7 @@ void vwm_draw_logo(vwm_t *vwm)
 		yoff++;
 		width -= 4;
 		xoff += 2;
+		height -= 2;
 	}
 
 	XUngrabServer(VWM_XDISPLAY(vwm));
-- 
cgit v1.2.3