X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fbarcode.c;fp=hacks%2Fbarcode.c;h=271aad9948283fbf212d26b80356a6ee537507eb;hp=cd3038ce534b1bf4fc109b621232a387bb3bf6db;hb=39809ded547bdbb08207d3e514950425215b4410;hpb=4361b69d3178d7fc98d0388f9a223af6c2651aba diff --git a/hacks/barcode.c b/hacks/barcode.c index cd3038ce..271aad99 100644 --- a/hacks/barcode.c +++ b/hacks/barcode.c @@ -1635,6 +1635,12 @@ static void scrollModel (struct state *st) st->barcodes[st->barcode_count - 1].mag * BARCODE_WIDTH); barcode->x += RAND_FLOAT_01 * 100; barcode->mag = RAND_FLOAT_01 * MAX_MAG; + + if (st->windowWidth < 100 || st->windowHeight < 100) { + barcode->mag *= 0.5; + if (barcode->mag <= 0) barcode->mag = 1; + } + barcode->y = RAND_FLOAT_01 * (st->windowHeight - BARCODE_HEIGHT * barcode->mag); if (barcode->y < 0)