summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilip J. Freeman <elektron@halo.nu>2018-04-11 12:54:53 -0700
committerVito Caputo <vcaputo@pengaru.com>2018-04-11 16:52:12 -0700
commit4183fbdc44fd34473e0d99e2ac3034340f06763e (patch)
tree117f467aafd39718cb8e9dc375f0aacf665363d4 /src
parentd3f66266f01283d8a9e78ac0ffa9620d34d24850 (diff)
logo: fix an edge case where logo is drawn forever
height = 2560 /3 = 853 while ( height -= 2) { // never hits 0 ... }
Diffstat (limited to 'src')
-rw-r--r--src/logo.c3
1 files changed, 2 insertions, 1 deletions
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));
© All Rights Reserved