Branch: Tag:

2000-03-14

2000-03-14 00:32:25 by Martin Stjernholm <mast@lysator.liu.se>

Propagate the original alpha channel from GText.make_text_image() instead
of recalculating it in the gtext module. It's both faster and avoids the
confusing all-transparent images when fgcolor and bgcolor happen to be
too close to each other.

Rev: server/etc/modules/GText.pmod:1.8
Rev: server/modules/graphics/graphic_text.pike:1.210

1:   // This is a roxen module. Copyright © 1996 - 2000, Roxen IS.   //    - constant cvs_version="$Id: graphic_text.pike,v 1.209 2000/03/02 04:18:37 nilsson Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.210 2000/03/14 00:32:23 mast Exp $";      #include <module.h>   inherit "module";
553:    (args->afont||args->font||args->nfont)+ ")!\n");       // Fonts and such are now initialized. -  img = GText.make_text_image(args, font, text, id); +  [img, Image.Image alpha] = GText.make_text_image(args, font, text, id);       // Now we have the image in 'img'.   
561:    {    if(!args->notrans)    { -  array (int) bgcolor = parse_color(args->bgcolor); -  Image.Image alpha; -  alpha = img->distancesq( @bgcolor ); -  alpha->gamma( 8 ); +     return ([ "img":img, "alpha":alpha ]);    }    return img;