Commit 79e13a1c authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

app/tools/gimpdrawtool.c app/tools/gimpselectiontool.c

2004-03-10  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimpdrawtool.c
	* app/tools/gimpselectiontool.c
	* app/tools/gimptool.c
	* app/tools/gimptransformtool.c: minor cleanup.
parent 860f3d46
2004-03-10 Michael Natterer <mitch@gimp.org>
* app/tools/gimpdrawtool.c
* app/tools/gimpselectiontool.c
* app/tools/gimptool.c
* app/tools/gimptransformtool.c: minor cleanup.
2004-03-10 Michael Natterer <mitch@gimp.org>
 
* app/tools/tool_manager.c (tool_manager_image_dirty): don't
......@@ -944,6 +944,7 @@ gimp_draw_tool_on_vectors_handle (GimpDrawTool *draw_tool,
*ret_anchor = NULL;
if (ret_stroke)
*ret_stroke = NULL;
return FALSE;
}
......@@ -1031,8 +1032,6 @@ gimp_draw_tool_on_vectors (GimpDrawTool *draw_tool,
GimpVectors **ret_vectors)
{
GList *list;
GimpVectors *vectors;
gboolean on_curve;
if (ret_coords) *ret_coords = *coords;
if (ret_pos) *ret_pos = -1.0;
......@@ -1045,22 +1044,20 @@ gimp_draw_tool_on_vectors (GimpDrawTool *draw_tool,
list;
list = g_list_next (list))
{
vectors = list->data;
GimpVectors *vectors = list->data;
if (! gimp_item_get_visible (GIMP_ITEM (vectors)))
continue;
on_curve = gimp_draw_tool_on_vectors_curve (draw_tool,
gdisp,
vectors, coords,
width, height,
ret_coords,
ret_pos,
ret_segment_start,
ret_segment_end,
ret_stroke);
if (on_curve)
if (gimp_draw_tool_on_vectors_curve (draw_tool,
gdisp,
vectors, coords,
width, height,
ret_coords,
ret_pos,
ret_segment_start,
ret_segment_end,
ret_stroke))
{
if (ret_vectors)
*ret_vectors = vectors;
......
......@@ -68,18 +68,18 @@ gimp_selection_tool_get_type (void)
static const GTypeInfo tool_info =
{
sizeof (GimpSelectionToolClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_selection_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpSelectionTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_selection_tool_init,
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_selection_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpSelectionTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_selection_tool_init,
};
tool_type = g_type_register_static (GIMP_TYPE_DRAW_TOOL,
"GimpSelectionTool",
"GimpSelectionTool",
&tool_info, 0);
}
......@@ -89,9 +89,7 @@ gimp_selection_tool_get_type (void)
static void
gimp_selection_tool_class_init (GimpSelectionToolClass *klass)
{
GimpToolClass *tool_class;
tool_class = GIMP_TOOL_CLASS (klass);
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
......@@ -104,10 +102,6 @@ gimp_selection_tool_class_init (GimpSelectionToolClass *klass)
static void
gimp_selection_tool_init (GimpSelectionTool *selection_tool)
{
GimpTool *tool;
tool = GIMP_TOOL (selection_tool);
selection_tool->op = SELECTION_REPLACE;
selection_tool->saved_op = SELECTION_REPLACE;
}
......@@ -246,12 +240,10 @@ gimp_selection_tool_cursor_update (GimpTool *tool,
GdkModifierType state,
GimpDisplay *gdisp)
{
GimpSelectionTool *selection_tool;
GimpSelectionTool *selection_tool = GIMP_SELECTION_TOOL (tool);
GimpToolCursorType tool_cursor;
GimpCursorModifier cmodifier;
selection_tool = GIMP_SELECTION_TOOL (tool);
tool_cursor = gimp_tool_control_get_tool_cursor (tool->control);
cmodifier = GIMP_CURSOR_MODIFIER_NONE;
......@@ -263,7 +255,7 @@ gimp_selection_tool_cursor_update (GimpTool *tool,
case SELECTION_SUBTRACT:
cmodifier = GIMP_CURSOR_MODIFIER_MINUS;
break;
case SELECTION_INTERSECT:
case SELECTION_INTERSECT:
cmodifier = GIMP_CURSOR_MODIFIER_INTERSECT;
break;
case SELECTION_REPLACE:
......
......@@ -94,7 +94,7 @@ static void gimp_tool_real_cursor_update (GimpTool *tool,
static GimpObjectClass *parent_class = NULL;
static gint global_tool_ID = 0;
static gint global_tool_ID = 1;
GType
......@@ -128,9 +128,7 @@ gimp_tool_get_type (void)
static void
gimp_tool_class_init (GimpToolClass *klass)
{
GObjectClass *object_class;
object_class = G_OBJECT_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
......@@ -195,9 +193,7 @@ gimp_tool_set_property (GObject *object,
const GValue *value,
GParamSpec *pspec)
{
GimpTool *tool;
tool = GIMP_TOOL (object);
GimpTool *tool = GIMP_TOOL (object);
switch (property_id)
{
......@@ -217,9 +213,7 @@ gimp_tool_get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
GimpTool *tool;
tool = GIMP_TOOL (object);
GimpTool *tool = GIMP_TOOL (object);
switch (property_id)
{
......@@ -367,8 +361,8 @@ gimp_tool_control (GimpTool *tool,
}
else
{
g_warning ("gimp_tool_control(): "
"unable to RESUME tool with tool->paused_count == 0");
g_warning ("gimp_tool_control: unable to RESUME tool with "
"tool->control->paused_count == 0");
}
break;
......
......@@ -683,16 +683,16 @@ gimp_transform_tool_draw (GimpDrawTool *draw_tool)
/* We test if the transformed polygon is convex.
* if z1 and z2 have the same sign as well as z3 and z4
* the polygon is convex. */
z1 = (tr_tool->tx2-tr_tool->tx1)*(tr_tool->ty4-tr_tool->ty1)
-(tr_tool->tx4-tr_tool->tx1)*(tr_tool->ty2-tr_tool->ty1);
z2 = (tr_tool->tx4-tr_tool->tx1)*(tr_tool->ty3-tr_tool->ty1)
-(tr_tool->tx3-tr_tool->tx1)*(tr_tool->ty4-tr_tool->ty1);
z3 = (tr_tool->tx4-tr_tool->tx2)*(tr_tool->ty3-tr_tool->ty2)
-(tr_tool->tx3-tr_tool->tx2)*(tr_tool->ty4-tr_tool->ty2);
z4 = (tr_tool->tx3-tr_tool->tx2)*(tr_tool->ty1-tr_tool->ty2)
-(tr_tool->tx1-tr_tool->tx2)*(tr_tool->ty3-tr_tool->ty2);
* the polygon is convex.
*/
z1 = (tr_tool->tx2-tr_tool->tx1 * tr_tool->ty4-tr_tool->ty1 -
tr_tool->tx4-tr_tool->tx1 * tr_tool->ty2-tr_tool->ty1);
z2 = (tr_tool->tx4-tr_tool->tx1 * tr_tool->ty3-tr_tool->ty1 -
tr_tool->tx3-tr_tool->tx1 * tr_tool->ty4-tr_tool->ty1);
z3 = (tr_tool->tx4-tr_tool->tx2 * tr_tool->ty3-tr_tool->ty2 -
tr_tool->tx3-tr_tool->tx2 * tr_tool->ty4-tr_tool->ty2);
z4 = (tr_tool->tx3-tr_tool->tx2 * tr_tool->ty1-tr_tool->ty2 -
tr_tool->tx1-tr_tool->tx2 * tr_tool->ty3-tr_tool->ty2);
/* Draw the grid (not for path transform since it looks ugly) */
......@@ -819,9 +819,11 @@ gimp_transform_tool_real_transform (GimpTransformTool *tr_tool,
NULL, NULL);
if (gimp_item_get_linked (active_item))
gimp_item_linked_transform (active_item, &tr_tool->transform,
gimp_item_linked_transform (active_item,
&tr_tool->transform,
options->direction,
options->interpolation, options->clip,
options->interpolation,
options->clip,
progress ?
gimp_progress_update_and_flush : NULL,
progress);
......@@ -1041,7 +1043,7 @@ gimp_transform_tool_transform_bounding_box (GimpTransformTool *tr_tool)
tr_tool->cx, tr_tool->cy,
&tr_tool->tcx, &tr_tool->tcy);
if (tr_tool->grid_coords != NULL && tr_tool->tgrid_coords != NULL)
if (tr_tool->grid_coords && tr_tool->tgrid_coords)
{
gint i, k;
gint gci;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment