Roxen.git / server / modules / graphics / graphic_text.pike

version» Context lines:

Roxen.git/server/modules/graphics/graphic_text.pike:1: - constant cvs_version="$Id: graphic_text.pike,v 1.162 1999/01/21 15:51:19 marcus Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.163 1999/01/24 23:38:38 grubba Exp $";   constant thread_safe=1;      #include <module.h>   #include <stat.h>   inherit "module";   inherit "roxenlib";      #ifndef VAR_MORE   #define VAR_MORE 0   #endif /* VAR_MORE */
Roxen.git/server/modules/graphics/graphic_text.pike:541:    string bg;    sscanf(args->textbox, "%d,%s", alpha, bg);    sscanf(bg,"%s,%d", bg,border);    background->paste_alpha(Image.image(txsize+border*2,tysize+border*2,    @parse_color(bg)),    255-(alpha*255/100),xoffset-border,yoffset-border);    }       if(args->ghost)    { // Francesco.. -  int sdist = (int)args->ghost; -  int bl=(int)(args->ghost/",")[1]; -  array(int)clr=parse_color((args->ghost/",")[-1]); +  array(string) a = (args->ghost/","); +  if (sizeof(a) < 2) { +  // Bad argument. +  } else { +  int sdist = (int)(a[0]); +  int bl=(int)(a[1]); +  array(int)clr=parse_color(a[-1]);    int j;    object ta = text_alpha->copy();    for (j=0;j<bl;j++)    ta=ta->apply_matrix(({    ({6,7,7,7,6}),({7,8,8,8,7}),({7,8,8,8,7}),({7,8,8,8,7}),({6,7,7,7,6})    }));    background->paste_alpha_color(ta,@clr,xoffset+sdist,yoffset+sdist);    fgcolor=bgcolor;    } -  +  }          if(args->shadow)    {    int sd = ((int)args->shadow+10)*2;    int sdist = ((int)(args->shadow/",")[-1])+2;    object ta = text_alpha->copy();    ta = ta->color(256-sd,256-sd,256-sd);    array sc = parse_color(args->scolor||"black");    background->paste_alpha_color(ta,sc[0],sc[1],sc[2],