app: some more code removal and cleanup in the transform classes

This commit is contained in:
Michael Natterer 2011-03-28 01:20:16 +02:00
parent dde7d6c0ee
commit 4097825f3c
3 changed files with 6 additions and 42 deletions

View File

@ -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;

View File

@ -69,8 +69,7 @@ struct _GimpPerspectiveCloneTool
struct _GimpPerspectiveCloneToolClass
{
GimpBrushToolClass parent_class;
GimpBrushToolClass parent_class;
};

View File

@ -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->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->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: