Branch: Tag:

2000-02-08

2000-02-08 03:40:08 by Per Hedbor <ph@opera.com>

Set names etc. in the layer objects

Rev: lib/modules/_Image_XCF.pmod:1.9

438:    what = __decode( what );       mapping lopts = ([ "tiled":1, ]); +  array layers = ({});    if( opts->background )    {    lopts->image = Image.Image( 32, 32, opts->background );    lopts->alpha = Image.Image( 32, 32, Image.Color.white );    lopts->alpha_value = 1.0; -  } else { -  lopts->image = Image.Image( 32, 32, Image.Color.black ); -  lopts->alpha = Image.Image( 32, 32, Image.Color.black ); -  lopts->alpha_value = 0.0; +  layers = ({ Image.Layer( lopts ) });    } -  array layers = ({ Image.Layer( lopts ) }); +        foreach(what->layers, object l)    {
458:    Image.Layer lay = Image.Layer( h->img,    h->alpha,    translate_mode( l->mode ) ); +  +  +  /* Not really layer related */ +  lay->set_misc_value( "image_xres", l->parent->xres ); +  lay->set_misc_value( "image_yres", l->parent->yres ); +  lay->set_misc_value( "image_colormap", l->parent->colormap ); +  lay->set_misc_value( "image_guides", l->parent->guides ); +  lay->set_misc_value( "image_parasites", l->parent->parasites ); +  +  /* But these are. :) */ +  lay->set_misc_value( "name", l->name ); +  lay->set_misc_value( "tattoo", l->tattoo ); +  lay->set_misc_value( "parasites", l->parasites ); +  lay->set_misc_value( "visible", l->flags->visible ); +  if( l == l->parent->active_layer ) +  lay->set_misc_value( "active", 1 ); +     h->img = 0; h->alpha = 0;       lay->set_alpha_value( l->opacity / 255.0 );