Commit cdbb8e16 authored by Michael Natterer's avatar Michael Natterer 😴

Fix loading of layer trees when there is a floating selection

A floating selection is always the first layer in the image, but on
XCF loading it is attached *after* all layers are loaded, so the item
paths for child layers read from the XCF are off-by-one in their
toplevel index. Adjust them so everything loads as it should.
parent c6fa4f72
......@@ -210,6 +210,22 @@ xcf_load_image (Gimp *gimp,
if (item_path)
{
if (info->floating_sel)
{
/* there is a floating selection, but it will get
* added after all layers are loaded, so toplevel
* layer indices are off-by-one. Adjust item paths
* accordingly:
*/
gint toplevel_index;
toplevel_index = GPOINTER_TO_UINT (item_path->data);
toplevel_index--;
item_path->data = GUINT_TO_POINTER (toplevel_index);
}
parent = GIMP_LAYER
(gimp_item_stack_get_parent_by_path (GIMP_ITEM_STACK (layers),
item_path,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment