Warn the user if the geometry doesn't fit the screen

This commit is contained in:
LemonBoy 2014-02-21 20:56:17 +00:00
parent b70edf4c4b
commit b01de5cb48

9
bar.c
View File

@ -850,12 +850,13 @@ main (int argc, char **argv)
bx = geom_v[2]; bx = geom_v[2];
/* Sanitize the arguments */ /* Sanitize the arguments */
if (bx >= scr->width_in_pixels || bx + bw >= scr->width_in_pixels) { if (bx >= scr->width_in_pixels || bx + bw > scr->width_in_pixels) {
bx = 0; fprintf(stderr, "The geometry specified doesn't fit the screen!\n");
bw = -1; return;
} }
if (bu >= bh) if (bu >= bh)
bu = 1; bu %= bh;
if (ba > 1.0f) if (ba > 1.0f)
ba = 1.0f; ba = 1.0f;
if (ba < 0.0f) if (ba < 0.0f)