[gimp] app: fix gimp_pdb_item_is_modifyable() for channels
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: fix gimp_pdb_item_is_modifyable() for channels
- Date: Fri, 20 Apr 2018 17:17:57 +0000 (UTC)
commit a1081bd5956399da6f39301d66df8ea4cafba3fe
Author: Michael Natterer <mitch gimp org>
Date: Fri Apr 20 19:13:47 2018 +0200
app: fix gimp_pdb_item_is_modifyable() for channels
When a channel is position-locked, it is also implicitly
content-locked because we translate channels by modifying their
pixels.
app/pdb/gimppdb-utils.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/app/pdb/gimppdb-utils.c b/app/pdb/gimppdb-utils.c
index d5f8e34..ecae7ae 100644
--- a/app/pdb/gimppdb-utils.c
+++ b/app/pdb/gimppdb-utils.c
@@ -26,6 +26,7 @@
#include "core/gimp.h"
#include "core/gimpbrushgenerated.h"
+#include "core/gimpchannel.h"
#include "core/gimpcontainer.h"
#include "core/gimpdatafactory.h"
#include "core/gimpdrawable.h"
@@ -566,6 +567,13 @@ gimp_pdb_item_is_modifyable (GimpItem *item,
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+ /* When a channel is position-locked, it is also implicitly
+ * content-locked because we translate channels by modifying their
+ * pixels.
+ */
+ if ((modify & GIMP_PDB_ITEM_POSITION) && GIMP_IS_CHANNEL (item))
+ modify |= GIMP_PDB_ITEM_CONTENT;
+
if ((modify & GIMP_PDB_ITEM_CONTENT) && gimp_item_is_content_locked (item))
{
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]