mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-22 12:32:37 +00:00
app/tools/gimpperspectivetool.c app/tools/gimprotatetool.c
2004-06-14 Michael Natterer <mitch@gimp.org> * app/tools/gimpperspectivetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c: removed calls to gimp_transform_tool_expose_preview() from all GimpTransformTool::motion() implementations... * app/tools/gimptransformtool.c: ...and call it after calling tr_tool_class->preview().
This commit is contained in:
parent
1082ee6b94
commit
4c68bd878a
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2004-06-14 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/tools/gimpperspectivetool.c
|
||||
* app/tools/gimprotatetool.c
|
||||
* app/tools/gimpscaletool.c
|
||||
* app/tools/gimpsheartool.c: removed calls to
|
||||
gimp_transform_tool_expose_preview() from all
|
||||
GimpTransformTool::motion() implementations...
|
||||
|
||||
* app/tools/gimptransformtool.c: ...and call it after calling
|
||||
tr_tool_class->preview().
|
||||
|
||||
2004-06-14 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/display/gimpdisplayshell.[ch]: remember the last used
|
||||
|
|
|
@ -98,18 +98,18 @@ gimp_perspective_tool_get_type (void)
|
|||
static const GTypeInfo tool_info =
|
||||
{
|
||||
sizeof (GimpPerspectiveToolClass),
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) gimp_perspective_tool_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GimpPerspectiveTool),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gimp_perspective_tool_init,
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) gimp_perspective_tool_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GimpPerspectiveTool),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gimp_perspective_tool_init,
|
||||
};
|
||||
|
||||
tool_type = g_type_register_static (GIMP_TYPE_TRANSFORM_TOOL,
|
||||
"GimpPerspectiveTool",
|
||||
"GimpPerspectiveTool",
|
||||
&tool_info, 0);
|
||||
}
|
||||
|
||||
|
@ -119,9 +119,7 @@ gimp_perspective_tool_get_type (void)
|
|||
static void
|
||||
gimp_perspective_tool_class_init (GimpPerspectiveToolClass *klass)
|
||||
{
|
||||
GimpTransformToolClass *trans_class;
|
||||
|
||||
trans_class = GIMP_TRANSFORM_TOOL_CLASS (klass);
|
||||
GimpTransformToolClass *trans_class = GIMP_TRANSFORM_TOOL_CLASS (klass);
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
|
@ -209,8 +207,6 @@ gimp_perspective_tool_motion (GimpTransformTool *transform_tool,
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
gimp_transform_tool_expose_preview (transform_tool);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -270,12 +270,11 @@ gimp_rotate_tool_motion (GimpTransformTool *tr_tool,
|
|||
tr_tool->cx = tr_tool->curx;
|
||||
tr_tool->cy = tr_tool->cury;
|
||||
|
||||
gimp_transform_tool_expose_preview (tr_tool);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
options = GIMP_TRANSFORM_OPTIONS (GIMP_TOOL (tr_tool)->tool_info->tool_options);
|
||||
options =
|
||||
GIMP_TRANSFORM_OPTIONS (GIMP_TOOL (tr_tool)->tool_info->tool_options);
|
||||
|
||||
cx = tr_tool->trans_info[CENTER_X];
|
||||
cy = tr_tool->trans_info[CENTER_Y];
|
||||
|
@ -319,8 +318,6 @@ gimp_rotate_tool_motion (GimpTransformTool *tr_tool,
|
|||
{
|
||||
tr_tool->trans_info[ANGLE] = tr_tool->trans_info[REAL_ANGLE];
|
||||
}
|
||||
|
||||
gimp_transform_tool_expose_preview (tr_tool);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -377,7 +374,7 @@ rotate_angle_changed (GtkWidget *widget,
|
|||
gimp_rotate_tool_recalc (tr_tool, GIMP_TOOL (tr_tool)->gdisp);
|
||||
|
||||
gimp_transform_tool_expose_preview (tr_tool);
|
||||
|
||||
|
||||
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tr_tool));
|
||||
}
|
||||
|
||||
|
@ -407,7 +404,7 @@ rotate_center_changed (GtkWidget *widget,
|
|||
gimp_rotate_tool_recalc (tr_tool, GIMP_TOOL (tr_tool)->gdisp);
|
||||
|
||||
gimp_transform_tool_expose_preview (tr_tool);
|
||||
|
||||
|
||||
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tr_tool));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -321,8 +321,6 @@ gimp_scale_tool_motion (GimpTransformTool *tr_tool,
|
|||
tr_tool->trans_info[X3] += diff_x;
|
||||
tr_tool->trans_info[Y3] += diff_y;
|
||||
|
||||
gimp_transform_tool_expose_preview (tr_tool);
|
||||
|
||||
return;
|
||||
|
||||
default:
|
||||
|
@ -380,8 +378,6 @@ gimp_scale_tool_motion (GimpTransformTool *tr_tool,
|
|||
*y1 = *y2 - dir_y * h;
|
||||
*x1 = *x2 - dir_x * w;
|
||||
}
|
||||
|
||||
gimp_transform_tool_expose_preview (tr_tool);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -262,8 +262,6 @@ gimp_shear_tool_motion (GimpTransformTool *tr_tool,
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
gimp_transform_tool_expose_preview (tr_tool);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -342,6 +340,6 @@ shear_y_mag_changed (GtkWidget *widget,
|
|||
|
||||
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tr_tool));
|
||||
}
|
||||
|
||||
|
||||
gimp_transform_tool_expose_preview (tr_tool);
|
||||
}
|
||||
|
|
|
@ -497,6 +497,8 @@ gimp_transform_tool_motion (GimpTool *tool,
|
|||
{
|
||||
tr_tool_class->motion (tr_tool, gdisp);
|
||||
|
||||
gimp_transform_tool_expose_preview (tr_tool);
|
||||
|
||||
if (tr_tool_class->recalc)
|
||||
tr_tool_class->recalc (tr_tool, gdisp);
|
||||
}
|
||||
|
@ -963,18 +965,18 @@ gimp_transform_tool_doit (GimpTransformTool *tr_tool,
|
|||
if (GIMP_IS_DISPLAY (GIMP_DRAW_TOOL (tr_tool)->gdisp))
|
||||
{
|
||||
GimpDisplayShell *shell;
|
||||
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (GIMP_DRAW_TOOL (tr_tool)->gdisp->shell);
|
||||
|
||||
if (gimp_display_shell_get_show_transform (shell))
|
||||
{
|
||||
gimp_display_shell_set_show_transform (shell, FALSE);
|
||||
|
||||
|
||||
/* get rid of preview artifacts left outside the drawable's area */
|
||||
gimp_transform_tool_expose_preview (tr_tool);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gimp_set_busy (gdisp->gimage->gimp);
|
||||
|
||||
/* undraw the tool before we muck around with the transform matrix */
|
||||
|
@ -1143,12 +1145,12 @@ gimp_transform_tool_expose_preview (GimpTransformTool *tr_tool)
|
|||
gint i;
|
||||
|
||||
g_return_if_fail (GIMP_IS_TRANSFORM_TOOL (tr_tool));
|
||||
|
||||
|
||||
options = GIMP_TRANSFORM_OPTIONS (GIMP_TOOL (tr_tool)->tool_info->tool_options);
|
||||
|
||||
|
||||
if (! (tr_tool->use_grid && options->show_preview))
|
||||
return;
|
||||
|
||||
|
||||
g_return_if_fail (GIMP_IS_DISPLAY (GIMP_DRAW_TOOL (tr_tool)->gdisp));
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (GIMP_DRAW_TOOL (tr_tool)->gdisp->shell);
|
||||
|
@ -1165,23 +1167,23 @@ gimp_transform_tool_expose_preview (GimpTransformTool *tr_tool)
|
|||
/* find bounding box around preview */
|
||||
area_x = area_w = (gint) dx [0];
|
||||
area_y = area_h = (gint) dy [0];
|
||||
|
||||
|
||||
for (i = 1; i < 4; i++)
|
||||
{
|
||||
if (dx [i] < area_x)
|
||||
area_x = (gint) dx [i];
|
||||
else if (dx [i] > area_w)
|
||||
area_w = (gint) dx [i];
|
||||
|
||||
|
||||
if (dy [i] < area_y)
|
||||
area_y = (gint) dy [i];
|
||||
else if (dy [i] > area_h)
|
||||
area_h = (gint) dy [i];
|
||||
}
|
||||
|
||||
|
||||
area_w -= area_x;
|
||||
area_h -= area_y;
|
||||
|
||||
|
||||
gimp_display_shell_expose_area (shell,
|
||||
MIN (area_x, last_x),
|
||||
MIN (area_y, last_y),
|
||||
|
@ -1203,13 +1205,13 @@ gimp_transform_tool_halt (GimpTransformTool *tr_tool)
|
|||
if (GIMP_IS_DISPLAY (GIMP_DRAW_TOOL (tr_tool)->gdisp))
|
||||
{
|
||||
GimpDisplayShell *shell;
|
||||
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (GIMP_DRAW_TOOL (tr_tool)->gdisp->shell);
|
||||
|
||||
if (gimp_display_shell_get_show_transform (shell))
|
||||
{
|
||||
gimp_display_shell_set_show_transform (shell, FALSE);
|
||||
|
||||
|
||||
/* get rid of preview artifacts left outside the drawable's area */
|
||||
gimp_transform_tool_expose_preview (tr_tool);
|
||||
}
|
||||
|
@ -1434,8 +1436,10 @@ gimp_transform_tool_prepare (GimpTransformTool *tr_tool,
|
|||
GimpDisplay *gdisp)
|
||||
{
|
||||
GimpTransformOptions *options;
|
||||
|
||||
options = GIMP_TRANSFORM_OPTIONS (GIMP_TOOL (tr_tool)->tool_info->tool_options);
|
||||
|
||||
options =
|
||||
GIMP_TRANSFORM_OPTIONS (GIMP_TOOL (tr_tool)->tool_info->tool_options);
|
||||
|
||||
gimp_display_shell_set_show_transform (GIMP_DISPLAY_SHELL (gdisp->shell),
|
||||
options->show_preview);
|
||||
|
||||
|
@ -1546,18 +1550,17 @@ gimp_transform_tool_notify_preview (GimpTransformOptions *options,
|
|||
gboolean show_preview;
|
||||
|
||||
if (! GIMP_IS_DISPLAY (GIMP_DRAW_TOOL (tr_tool)->gdisp))
|
||||
return;
|
||||
|
||||
return;
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (GIMP_DRAW_TOOL (tr_tool)->gdisp->shell);
|
||||
|
||||
|
||||
gimp_display_shell_set_show_transform (shell, options->show_preview);
|
||||
|
||||
/* expose area to clean up if preview is being turned off */
|
||||
show_preview = options->show_preview;
|
||||
options->show_preview = TRUE;
|
||||
|
||||
|
||||
gimp_transform_tool_expose_preview (tr_tool);
|
||||
|
||||
options->show_preview = show_preview;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue