[gimp] app: simplify gimp_transform_tool_modifier_key()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: simplify gimp_transform_tool_modifier_key()
- Date: Sat, 15 Jul 2017 17:17:30 +0000 (UTC)
commit 0a5251c97a7309a6d842766f1c0cc55b9a57e667
Author: Michael Natterer <mitch gimp org>
Date: Sat Jul 15 19:15:59 2017 +0200
app: simplify gimp_transform_tool_modifier_key()
No need to have n g_object_set() to set n properties, use one call
instead.
app/tools/gimptransformtool.c | 32 ++++++++------------------------
1 files changed, 8 insertions(+), 24 deletions(-)
---
diff --git a/app/tools/gimptransformtool.c b/app/tools/gimptransformtool.c
index e914e5c..f3971f5 100644
--- a/app/tools/gimptransformtool.c
+++ b/app/tools/gimptransformtool.c
@@ -451,35 +451,19 @@ gimp_transform_tool_modifier_key (GimpTool *tool,
if (key == gimp_get_constrain_behavior_mask ())
{
g_object_set (options,
- "frompivot-scale", ! options->frompivot_scale,
- NULL);
- g_object_set (options,
- "frompivot-shear", ! options->frompivot_shear,
- NULL);
- g_object_set (options,
+ "frompivot-scale", ! options->frompivot_scale,
+ "frompivot-shear", ! options->frompivot_shear,
"frompivot-perspective", ! options->frompivot_perspective,
NULL);
}
-
- if (key == gimp_get_extend_selection_mask ())
+ else if (key == gimp_get_extend_selection_mask ())
{
g_object_set (options,
- "cornersnap", ! options->cornersnap,
- NULL);
-
- g_object_set (options,
- "constrain-move", ! options->constrain_move,
- NULL);
- g_object_set (options,
- "constrain-scale", ! options->constrain_scale,
- NULL);
- g_object_set (options,
- "constrain-rotate", ! options->constrain_rotate,
- NULL);
- g_object_set (options,
- "constrain-shear", ! options->constrain_shear,
- NULL);
- g_object_set (options,
+ "cornersnap", ! options->cornersnap,
+ "constrain-move", ! options->constrain_move,
+ "constrain-scale", ! options->constrain_scale,
+ "constrain-rotate", ! options->constrain_rotate,
+ "constrain-shear", ! options->constrain_shear,
"constrain-perspective", ! options->constrain_perspective,
NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]