Skip to content
Snippets Groups Projects
Commit e6c0c48c authored by Per Hedbor's avatar Per Hedbor
Browse files

Set names etc. in the layer objects

Rev: lib/modules/_Image_XCF.pmod:1.9
parent 7fc81785
Branches
Tags
No related merge requests found
......@@ -438,17 +438,14 @@ array decode_layers( string|object|mapping what, mapping|void opts )
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,6 +455,23 @@ array decode_layers( string|object|mapping what, mapping|void opts )
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 );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment