[gimp] app: some more code removal and cleanup in the transform classes
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: some more code removal and cleanup in the transform classes
- Date: Sun, 27 Mar 2011 23:20:59 +0000 (UTC)
commit 4097825f3c3864f08367e7b7b701440cbae08431
Author: Michael Natterer <mitch gimp org>
Date: Mon Mar 28 01:20:16 2011 +0200
app: some more code removal and cleanup in the transform classes
app/tools/gimpperspectiveclonetool.c | 16 +---------------
app/tools/gimpperspectiveclonetool.h | 3 +--
app/tools/gimptransformtool.c | 29 ++++-------------------------
3 files changed, 6 insertions(+), 42 deletions(-)
---
diff --git a/app/tools/gimpperspectiveclonetool.c b/app/tools/gimpperspectiveclonetool.c
index 21f29a6..1567833 100644
--- a/app/tools/gimpperspectiveclonetool.c
+++ b/app/tools/gimpperspectiveclonetool.c
@@ -25,9 +25,7 @@
#include "tools-types.h"
#include "core/gimp-transform-utils.h"
-#include "core/gimpdrawable-transform.h"
#include "core/gimpimage.h"
-#include "core/gimpitem.h"
#include "paint/gimpperspectiveclone.h"
#include "paint/gimpperspectivecloneoptions.h"
@@ -166,17 +164,10 @@ static void
gimp_perspective_clone_tool_init (GimpPerspectiveCloneTool *clone_tool)
{
GimpTool *tool = GIMP_TOOL (clone_tool);
- gint i;
gimp_tool_control_set_action_object_2 (tool->control,
"context/context-pattern-select-set");
- for (i = 0; i < TRANS_INFO_SIZE; i++)
- {
- clone_tool->trans_info[i] = 0.0;
- clone_tool->old_trans_info[i] = 0.0;
- }
-
gimp_matrix3_identity (&clone_tool->transform);
}
@@ -217,7 +208,6 @@ gimp_perspective_clone_tool_initialize (GimpTool *tool,
GimpImage *image = gimp_display_get_image (display);
gint i;
- /* Set the pointer to the active display */
tool->display = display;
tool->drawable = gimp_image_get_active_drawable (image);
@@ -822,11 +812,7 @@ static void
gimp_perspective_clone_tool_bounds (GimpPerspectiveCloneTool *tool,
GimpDisplay *display)
{
- GimpImage *image;
-
- g_return_if_fail (GIMP_IS_DISPLAY (display));
-
- image = gimp_display_get_image (display);
+ GimpImage *image = gimp_display_get_image (display);
tool->x1 = 0;
tool->y1 = 0;
diff --git a/app/tools/gimpperspectiveclonetool.h b/app/tools/gimpperspectiveclonetool.h
index edf619e..8ac7bc1 100644
--- a/app/tools/gimpperspectiveclonetool.h
+++ b/app/tools/gimpperspectiveclonetool.h
@@ -69,8 +69,7 @@ struct _GimpPerspectiveCloneTool
struct _GimpPerspectiveCloneToolClass
{
- GimpBrushToolClass parent_class;
-
+ GimpBrushToolClass parent_class;
};
diff --git a/app/tools/gimptransformtool.c b/app/tools/gimptransformtool.c
index a95deba..0593ab4 100644
--- a/app/tools/gimptransformtool.c
+++ b/app/tools/gimptransformtool.c
@@ -191,7 +191,6 @@ static void
gimp_transform_tool_init (GimpTransformTool *tr_tool)
{
GimpTool *tool = GIMP_TOOL (tr_tool);
- gint i;
gimp_tool_control_set_action_value_1 (tool->control,
"tools/tools-transform-preview-opacity-set");
@@ -205,33 +204,14 @@ gimp_transform_tool_init (GimpTransformTool *tr_tool)
gimp_tool_control_set_precision (tool->control,
GIMP_CURSOR_PRECISION_SUBPIXEL);
- tr_tool->function = TRANSFORM_CREATING;
-
- for (i = 0; i < TRANS_INFO_SIZE; i++)
- {
- tr_tool->trans_info[i] = 0.0;
- tr_tool->old_trans_info[i] = 0.0;
- tr_tool->prev_trans_info[i] = 0.0;
- }
+ tr_tool->function = TRANSFORM_CREATING;
gimp_matrix3_identity (&tr_tool->transform);
- tr_tool->use_grid = FALSE;
- tr_tool->use_handles = FALSE;
- tr_tool->use_center = FALSE;
- tr_tool->use_mid_handles = FALSE;
-
- tr_tool->handle_w = GIMP_TOOL_HANDLE_SIZE_LARGE;
- tr_tool->handle_h = GIMP_TOOL_HANDLE_SIZE_LARGE;
-
- tr_tool->ngx = 0;
- tr_tool->ngy = 0;
- tr_tool->grid_coords = NULL;
-
- tr_tool->undo_desc = NULL;
+ tr_tool->handle_w = GIMP_TOOL_HANDLE_SIZE_LARGE;
+ tr_tool->handle_h = GIMP_TOOL_HANDLE_SIZE_LARGE;
- tr_tool->progress_text = _("Transforming");
- tr_tool->dialog = NULL;
+ tr_tool->progress_text = _("Transforming");
}
static void
@@ -1370,7 +1350,6 @@ gimp_transform_tool_bounds (GimpTransformTool *tr_tool,
GimpTransformOptions *options = GIMP_TRANSFORM_TOOL_GET_OPTIONS (tr_tool);
GimpImage *image = gimp_display_get_image (display);
- /* find the boundaries */
switch (options->type)
{
case GIMP_TRANSFORM_TYPE_LAYER:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]