app: some more gimp_image_get_active_drawable() removed.

No logics changed. These are places where we expect single layer
selected.
This commit is contained in:
Jehan 2020-08-02 00:37:49 +02:00
parent 248d2e95b8
commit 892fbafdf8
2 changed files with 12 additions and 2 deletions

View File

@ -88,11 +88,15 @@ buffers_paste_cmd_callback (GimpAction *action,
if (image)
{
gimp_edit_paste (image, gimp_image_get_active_drawable (image),
GList *drawables = gimp_image_get_selected_drawables (image);
gimp_edit_paste (image,
g_list_length (drawables) == 1 ? drawables->data : NULL,
GIMP_OBJECT (buffer), paste_type,
x, y, width, height);
gimp_image_flush (image);
g_list_free (drawables);
}
}
}

View File

@ -69,7 +69,13 @@ floating_sel_attach (GimpLayer *layer,
* to the drawable
*/
if (drawable == (GimpDrawable *) floating_sel)
drawable = gimp_image_get_active_drawable (image);
{
GList *drawables = gimp_image_get_selected_drawables (image);
g_return_if_fail (g_list_length (drawables) == 1);
drawable = drawables->data;
g_list_free (drawables);
}
}
gimp_layer_set_lock_alpha (layer, TRUE, FALSE);