copy the merged layer, not the first one. Preserve the type of the layer

2004-06-02  Michael Natterer  <mitch@gimp.org>

	* app/display/gimpdisplayshell-dnd.c
	(gimp_display_shell_drop_files): copy the merged layer, not the
	first one. Preserve the type of the layer to make e.g. dropping an
	XCF with a single text layer work.
This commit is contained in:
Michael Natterer 2004-06-01 23:49:50 +00:00 committed by Michael Natterer
parent 631b5b4d95
commit 4e9c58a589
2 changed files with 18 additions and 6 deletions

View File

@ -1,3 +1,10 @@
2004-06-02 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayshell-dnd.c
(gimp_display_shell_drop_files): copy the merged layer, not the
first one. Preserve the type of the layer to make e.g. dropping an
XCF with a single text layer work.
2004-06-02 Sven Neumann <sven@gimp.org>
* NEWS

View File

@ -296,18 +296,23 @@ gimp_display_shell_drop_files (GtkWidget *widget,
gimp_image_undo_disable (new_image);
if (gimp_container_num_children (new_image->layers) > 1)
gimp_image_merge_visible_layers (new_image, context,
GIMP_CLIP_TO_IMAGE);
layer = (GimpLayer *)
gimp_container_get_child_by_index (new_image->layers, 0);
{
layer = gimp_image_merge_visible_layers (new_image, context,
GIMP_CLIP_TO_IMAGE);
}
else
{
layer = (GimpLayer *)
gimp_container_get_child_by_index (new_image->layers, 0);
}
if (layer)
{
GimpItem *new_item;
new_item = gimp_item_convert (GIMP_ITEM (layer), gimage,
GIMP_TYPE_LAYER, TRUE);
G_TYPE_FROM_INSTANCE (layer),
TRUE);
if (new_item)
{