[gimp] app: allow switching fill type with Alt even when Pattern fill selected.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: allow switching fill type with Alt even when Pattern fill selected.
- Date: Mon, 10 Dec 2018 15:49:00 +0000 (UTC)
commit 5a157bf1ba662891e485b79fbd619736e7669288
Author: Jehan <jehan girinstud io>
Date: Sat Dec 8 10:54:38 2018 +0100
app: allow switching fill type with Alt even when Pattern fill selected.
Currently in bucket fill tool, the modifier was only switching fg to bg
and bg to fg, and was doing nothing when pattern was set. I make it
switch to fg as well (and remember which was the original value).
app/tools/gimpbucketfilltool.c | 34 +++++++++++++++++++++++-----------
1 file changed, 23 insertions(+), 11 deletions(-)
---
diff --git a/app/tools/gimpbucketfilltool.c b/app/tools/gimpbucketfilltool.c
index bf0f0f243f..e11c9077be 100644
--- a/app/tools/gimpbucketfilltool.c
+++ b/app/tools/gimpbucketfilltool.c
@@ -66,14 +66,17 @@ struct _GimpBucketFillToolPrivate
GWeakRef cached_image;
GWeakRef cached_drawable;
- GeglBuffer *fill_mask;
-
/* For preview */
GeglNode *graph;
GeglNode *fill_node;
GeglNode *offset_node;
+ GeglBuffer *fill_mask;
+
GimpDrawableFilter *filter;
+
+ /* Temp property save */
+ GimpBucketFillMode fill_mode;
};
/* local function prototypes */
@@ -621,18 +624,27 @@ gimp_bucket_fill_tool_modifier_key (GimpTool *tool,
if (key == GDK_MOD1_MASK)
{
- switch (options->fill_mode)
+ if (press)
{
- case GIMP_BUCKET_FILL_FG:
- g_object_set (options, "fill-mode", GIMP_BUCKET_FILL_BG, NULL);
- break;
+ GIMP_BUCKET_FILL_TOOL (tool)->priv->fill_mode = options->fill_mode;
+ switch (options->fill_mode)
+ {
+ case GIMP_BUCKET_FILL_FG:
+ g_object_set (options, "fill-mode", GIMP_BUCKET_FILL_BG, NULL);
+ break;
- case GIMP_BUCKET_FILL_BG:
- g_object_set (options, "fill-mode", GIMP_BUCKET_FILL_FG, NULL);
- break;
+ default: /* GIMP_BUCKET_FILL_BG && GIMP_BUCKET_FILL_PATTERN */
+ g_object_set (options, "fill-mode", GIMP_BUCKET_FILL_FG, NULL);
+ break;
- default:
- break;
+ break;
+ }
+ }
+ else /* release */
+ {
+ g_object_set (options, "fill-mode",
+ GIMP_BUCKET_FILL_TOOL (tool)->priv->fill_mode,
+ NULL);
}
}
else if (key == gimp_get_toggle_behavior_mask ())
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]