plug-ins: in file-psd, read/write layer group expanded state

Use the new gimp-item-{get,set}-expanded() PDB functions to read
and write group-layer expanded state in PSDs.
This commit is contained in:
Ell 2017-10-22 12:01:57 -04:00
parent 4db000a522
commit 6fb497247d
2 changed files with 8 additions and 1 deletions

View File

@ -1463,6 +1463,13 @@ add_layers (gint32 image_id,
/* Tattoo */ /* Tattoo */
if (lyr_a[lidx]->id) if (lyr_a[lidx]->id)
gimp_item_set_tattoo (layer_id, lyr_a[lidx]->id); gimp_item_set_tattoo (layer_id, lyr_a[lidx]->id);
/* For layer groups, expand or collapse the group */
if (lyr_a[lidx]->group_type != 0)
{
gimp_item_set_expanded (layer_id,
lyr_a[lidx]->group_type == 1);
}
} }
/* Insert the layer */ /* Insert the layer */

View File

@ -1082,7 +1082,7 @@ save_layer_and_mask (FILE *fd,
size = 12; size = 12;
if (PSDImageData.lLayers[i].type == PSD_LAYER_TYPE_GROUP_START) if (PSDImageData.lLayers[i].type == PSD_LAYER_TYPE_GROUP_START)
type = 1; type = gimp_item_get_expanded (PSDImageData.lLayers[i].id) ? 1 : 2;
else else
type = 3; type = 3;