Commit 6ed75230 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

use GimpCoords structs for cur_coords, last_coords and start_coords and

2001-11-13  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimppainttool.[ch]: use GimpCoords structs for
	cur_coords, last_coords and start_coords and the undo struct
	instead of storing separate gdouble values.

	* app/undo.c
	* app/tools/gimpairbrushtool.c
	* app/tools/gimpclonetool.c
	* app/tools/gimpconvolvetool.c
	* app/tools/gimpdodgeburntool.c
	* app/tools/gimperasertool.c
	* app/tools/gimppaintbrushtool.c
	* app/tools/gimppenciltool.c
	* app/tools/gimpsmudgetool.c: changed accordingly.
parent 95bc70d9
2001-11-13 Michael Natterer <mitch@gimp.org>
* app/tools/gimppainttool.[ch]: use GimpCoords structs for
cur_coords, last_coords and start_coords and the undo struct
instead of storing separate gdouble values.
* app/undo.c
* app/tools/gimpairbrushtool.c
* app/tools/gimpclonetool.c
* app/tools/gimpconvolvetool.c
* app/tools/gimpdodgeburntool.c
* app/tools/gimperasertool.c
* app/tools/gimppaintbrushtool.c
* app/tools/gimppenciltool.c
* app/tools/gimpsmudgetool.c: changed accordingly.
2001-11-13 Michael Natterer <mitch@gimp.org> 2001-11-13 Michael Natterer <mitch@gimp.org>
* app/base/temp-buf.c: allow passing NULL to temp_buf_resize() again. * app/base/temp-buf.c: allow passing NULL to temp_buf_resize() again.
......
...@@ -1411,7 +1411,7 @@ undo_pop_paint (GimpImage *gimage, ...@@ -1411,7 +1411,7 @@ undo_pop_paint (GimpImage *gimage,
GimpTool *active_tool; GimpTool *active_tool;
GimpPaintTool *pt; GimpPaintTool *pt;
PaintUndo *pu; PaintUndo *pu;
gdouble tmp; GimpCoords tmp_coords;
active_tool = tool_manager_get_active (gimage->gimp); active_tool = tool_manager_get_active (gimage->gimp);
...@@ -1427,25 +1427,9 @@ undo_pop_paint (GimpImage *gimage, ...@@ -1427,25 +1427,9 @@ undo_pop_paint (GimpImage *gimage,
return TRUE; return TRUE;
/* swap the paint core information */ /* swap the paint core information */
tmp = pt->lastx; tmp_coords = pt->last_coords;
pt->lastx = pu->lastx; pt->last_coords = pu->last_coords;
pu->lastx = tmp; pu->last_coords = tmp_coords;
tmp = pt->lasty;
pt->lasty = pu->lasty;
pu->lasty = tmp;
tmp = pt->lastpressure;
pt->lastpressure = pu->lastpressure;
pu->lastpressure = tmp;
tmp = pt->lastxtilt;
pt->lastxtilt = pu->lastxtilt;
pu->lastxtilt = tmp;
tmp = pt->lastytilt;
pt->lastytilt = pu->lastytilt;
pu->lastytilt = tmp;
return TRUE; return TRUE;
} }
......
...@@ -278,7 +278,7 @@ gimp_airbrush_tool_paint (GimpPaintTool *paint_tool, ...@@ -278,7 +278,7 @@ gimp_airbrush_tool_paint (GimpPaintTool *paint_tool,
airbrush_timeout.drawable = drawable; airbrush_timeout.drawable = drawable;
timeout = (pressure_options->rate ? timeout = (pressure_options->rate ?
(10000 / (rate * 2.0 * paint_tool->curpressure)) : (10000 / (rate * 2.0 * paint_tool->cur_coords.pressure)) :
(10000 / rate)); (10000 / rate));
timer = gtk_timeout_add (timeout, airbrush_time_out, NULL); timer = gtk_timeout_add (timeout, airbrush_time_out, NULL);
...@@ -335,7 +335,7 @@ airbrush_time_out (gpointer client_data) ...@@ -335,7 +335,7 @@ airbrush_time_out (gpointer client_data)
if (pressure_options->rate) if (pressure_options->rate)
{ {
/* set a new timer */ /* set a new timer */
timer = gtk_timeout_add ((10000 / (rate * 2.0 * airbrush_timeout.paint_tool->curpressure)), timer = gtk_timeout_add ((10000 / (rate * 2.0 * airbrush_timeout.paint_tool->cur_coords.pressure)),
airbrush_time_out, NULL); airbrush_time_out, NULL);
return FALSE; return FALSE;
} }
...@@ -369,7 +369,7 @@ gimp_airbrush_tool_motion (GimpPaintTool *paint_tool, ...@@ -369,7 +369,7 @@ gimp_airbrush_tool_motion (GimpPaintTool *paint_tool,
context = gimp_get_current_context (gimage->gimp); context = gimp_get_current_context (gimage->gimp);
if (pressure_options->size) if (pressure_options->size)
scale = paint_tool->curpressure; scale = paint_tool->cur_coords.pressure;
else else
scale = 1.0; scale = 1.0;
...@@ -382,7 +382,7 @@ gimp_airbrush_tool_motion (GimpPaintTool *paint_tool, ...@@ -382,7 +382,7 @@ gimp_airbrush_tool_motion (GimpPaintTool *paint_tool,
GimpRGB color; GimpRGB color;
gimp_gradient_get_color_at (gimp_context_get_gradient (context), gimp_gradient_get_color_at (gimp_context_get_gradient (context),
paint_tool->curpressure, &color); paint_tool->cur_coords.pressure, &color);
gimp_rgba_get_uchar (&color, gimp_rgba_get_uchar (&color,
&col[RED_PIX], &col[RED_PIX],
...@@ -412,7 +412,7 @@ gimp_airbrush_tool_motion (GimpPaintTool *paint_tool, ...@@ -412,7 +412,7 @@ gimp_airbrush_tool_motion (GimpPaintTool *paint_tool,
} }
if (pressure_options->pressure) if (pressure_options->pressure)
pressure = pressure * 2.0 * paint_tool->curpressure; pressure = pressure * 2.0 * paint_tool->cur_coords.pressure;
/* paste the newly painted area to the image */ /* paste the newly painted area to the image */
gimp_paint_tool_paste_canvas (paint_tool, drawable, gimp_paint_tool_paste_canvas (paint_tool, drawable,
...@@ -463,20 +463,20 @@ airbrush_non_gui (GimpDrawable *drawable, ...@@ -463,20 +463,20 @@ airbrush_non_gui (GimpDrawable *drawable,
non_gui_pressure = pressure; non_gui_pressure = pressure;
non_gui_incremental = AIRBRUSH_DEFAULT_INCREMENTAL; non_gui_incremental = AIRBRUSH_DEFAULT_INCREMENTAL;
paint_tool->startx = paint_tool->lastx = stroke_array[0]; paint_tool->start_coords.x = paint_tool->last_coords.x = stroke_array[0];
paint_tool->starty = paint_tool->lasty = stroke_array[1]; paint_tool->start_coords.y = paint_tool->last_coords.y = stroke_array[1];
gimp_airbrush_tool_paint (paint_tool, drawable, MOTION_PAINT); gimp_airbrush_tool_paint (paint_tool, drawable, MOTION_PAINT);
for (i = 1; i < num_strokes; i++) for (i = 1; i < num_strokes; i++)
{ {
paint_tool->curx = stroke_array[i * 2 + 0]; paint_tool->cur_coords.x = stroke_array[i * 2 + 0];
paint_tool->cury = stroke_array[i * 2 + 1]; paint_tool->cur_coords.y = stroke_array[i * 2 + 1];
gimp_paint_tool_interpolate (paint_tool, drawable); gimp_paint_tool_interpolate (paint_tool, drawable);
paint_tool->lastx = paint_tool->curx; paint_tool->last_coords.x = paint_tool->cur_coords.x;
paint_tool->lasty = paint_tool->cury; paint_tool->last_coords.y = paint_tool->cur_coords.y;
} }
gimp_paint_tool_finish (paint_tool, drawable); gimp_paint_tool_finish (paint_tool, drawable);
......
...@@ -299,10 +299,10 @@ gimp_clone_tool_paint (GimpPaintTool *paint_tool, ...@@ -299,10 +299,10 @@ gimp_clone_tool_paint (GimpPaintTool *paint_tool,
break; break;
case MOTION_PAINT: case MOTION_PAINT:
x1 = paint_tool->curx; x1 = paint_tool->cur_coords.x;
y1 = paint_tool->cury; y1 = paint_tool->cur_coords.y;
x2 = paint_tool->lastx; x2 = paint_tool->last_coords.x;
y2 = paint_tool->lasty; y2 = paint_tool->last_coords.y;
/* If the control key is down, move the src target and return */ /* If the control key is down, move the src target and return */
if (paint_tool->state & GDK_CONTROL_MASK) if (paint_tool->state & GDK_CONTROL_MASK)
...@@ -344,8 +344,8 @@ gimp_clone_tool_paint (GimpPaintTool *paint_tool, ...@@ -344,8 +344,8 @@ gimp_clone_tool_paint (GimpPaintTool *paint_tool,
{ {
the_src_gdisp = gdisp; the_src_gdisp = gdisp;
clone_set_src_drawable(drawable); clone_set_src_drawable(drawable);
src_x = paint_tool->curx; src_x = paint_tool->cur_coords.x;
src_y = paint_tool->cury; src_y = paint_tool->cur_coords.y;
first = TRUE; first = TRUE;
} }
else if (clone_options->aligned == ALIGN_NO) else if (clone_options->aligned == ALIGN_NO)
...@@ -508,7 +508,7 @@ gimp_clone_tool_motion (GimpPaintTool *paint_tool, ...@@ -508,7 +508,7 @@ gimp_clone_tool_motion (GimpPaintTool *paint_tool,
context = gimp_get_current_context (gimage->gimp); context = gimp_get_current_context (gimage->gimp);
if (pressure_options->size) if (pressure_options->size)
scale = paint_tool->curpressure; scale = paint_tool->cur_coords.pressure;
else else
scale = 1.0; scale = 1.0;
...@@ -626,7 +626,7 @@ gimp_clone_tool_motion (GimpPaintTool *paint_tool, ...@@ -626,7 +626,7 @@ gimp_clone_tool_motion (GimpPaintTool *paint_tool,
opacity = 255.0 * gimp_context_get_opacity (context); opacity = 255.0 * gimp_context_get_opacity (context);
if (pressure_options->opacity) if (pressure_options->opacity)
opacity = opacity * 2.0 * paint_tool->curpressure; opacity = opacity * 2.0 * paint_tool->cur_coords.pressure;
/* paste the newly painted canvas to the gimage which is being worked on */ /* paste the newly painted canvas to the gimage which is being worked on */
gimp_paint_tool_paste_canvas (paint_tool, drawable, gimp_paint_tool_paste_canvas (paint_tool, drawable,
...@@ -774,20 +774,20 @@ gimp_clone_tool_non_gui (GimpDrawable *drawable, ...@@ -774,20 +774,20 @@ gimp_clone_tool_non_gui (GimpDrawable *drawable,
non_gui_paint_core.startx = non_gui_paint_core.lastx = stroke_array[0]; non_gui_paint_core.startx = non_gui_paint_core.lastx = stroke_array[0];
non_gui_paint_core.starty = non_gui_paint_core.lasty = stroke_array[1]; non_gui_paint_core.starty = non_gui_paint_core.lasty = stroke_array[1];
non_gui_offset_x = (int) (src_x - non_gui_paint_core.startx); non_gui_offset_x = (int) (src_x - non_gui_paint_core.start_coords.x);
non_gui_offset_y = (int) (src_y - non_gui_paint_core.starty); non_gui_offset_y = (int) (src_y - non_gui_paint_core.start_coords.y);
clone_non_gui_paint_func (&non_gui_paint_core, drawable, 0); clone_non_gui_paint_func (&non_gui_paint_core, drawable, 0);
for (i = 1; i < num_strokes; i++) for (i = 1; i < num_strokes; i++)
{ {
non_gui_paint_core.curx = stroke_array[i * 2 + 0]; non_gui_paint_core.cur_coords.x = stroke_array[i * 2 + 0];
non_gui_paint_core.cury = stroke_array[i * 2 + 1]; non_gui_paint_core.cur_coords.y = stroke_array[i * 2 + 1];
paint_core_interpolate (&non_gui_paint_core, drawable); paint_core_interpolate (&non_gui_paint_core, drawable);
non_gui_paint_core.lastx = non_gui_paint_core.curx; non_gui_paint_core.last_coords.x = non_gui_paint_core.cur_coords.x;
non_gui_paint_core.lasty = non_gui_paint_core.cury; non_gui_paint_core.last_coords.y = non_gui_paint_core.cur_coords.y;
} }
/* Finish the painting */ /* Finish the painting */
......
...@@ -342,7 +342,7 @@ gimp_convolve_tool_motion (GimpPaintTool *paint_tool, ...@@ -342,7 +342,7 @@ gimp_convolve_tool_motion (GimpPaintTool *paint_tool,
return; return;
if (pressure_options->size) if (pressure_options->size)
scale = paint_tool->curpressure; scale = paint_tool->cur_coords.pressure;
else else
scale = 1.0; scale = 1.0;
...@@ -366,19 +366,19 @@ gimp_convolve_tool_motion (GimpPaintTool *paint_tool, ...@@ -366,19 +366,19 @@ gimp_convolve_tool_motion (GimpPaintTool *paint_tool,
destPR.data = temp_buf_data (area); destPR.data = temp_buf_data (area);
if (pressure_options->rate) if (pressure_options->rate)
rate = rate * 2.0 * paint_tool->curpressure; rate = rate * 2.0 * paint_tool->cur_coords.pressure;
calculate_matrix (type, rate); calculate_matrix (type, rate);
/* Image region near edges? If so, paint area will be clipped */ /* Image region near edges? If so, paint area will be clipped */
/* with respect to brush mask + 1 pixel border (# 19285) */ /* with respect to brush mask + 1 pixel border (# 19285) */
if ((marginx = (gint) paint_tool->curx - paint_tool->brush->mask->width / 2 - 1) != area->x) if ((marginx = (gint) paint_tool->cur_coords.x - paint_tool->brush->mask->width / 2 - 1) != area->x)
area_hclip = CONVOLVE_NCLIP; area_hclip = CONVOLVE_NCLIP;
else if ((marginx = area->width - paint_tool->brush->mask->width - 2) != 0) else if ((marginx = area->width - paint_tool->brush->mask->width - 2) != 0)
area_hclip = CONVOLVE_PCLIP; area_hclip = CONVOLVE_PCLIP;
if ((marginy = (gint) paint_tool->cury - paint_tool->brush->mask->height / 2 - 1) != area->y) if ((marginy = (gint) paint_tool->cur_coords.y - paint_tool->brush->mask->height / 2 - 1) != area->y)
area_vclip = CONVOLVE_NCLIP; area_vclip = CONVOLVE_NCLIP;
else if ((marginy = area->height - paint_tool->brush->mask->height - 2) != 0) else if ((marginy = area->height - paint_tool->brush->mask->height - 2) != 0)
area_vclip = CONVOLVE_PCLIP; area_vclip = CONVOLVE_PCLIP;
...@@ -453,8 +453,10 @@ gimp_convolve_tool_motion (GimpPaintTool *paint_tool, ...@@ -453,8 +453,10 @@ gimp_convolve_tool_motion (GimpPaintTool *paint_tool,
fillcolor = gimp_drawable_get_color_at fillcolor = gimp_drawable_get_color_at
(drawable, (drawable,
CLAMP ((gint) paint_tool->curx, 0, gimp_drawable_width (drawable) - 1), CLAMP ((gint) paint_tool->cur_coords.x,
CLAMP ((gint) paint_tool->cury, 0, gimp_drawable_height (drawable) - 1)); 0, gimp_drawable_width (drawable) - 1),
CLAMP ((gint) paint_tool->cur_coords.y,
0, gimp_drawable_height (drawable) - 1));
marginx *= (marginx < 0) ? -1 : 0; marginx *= (marginx < 0) ? -1 : 0;
marginy *= (marginy < 0) ? -1 : 0; marginy *= (marginy < 0) ? -1 : 0;
...@@ -657,13 +659,13 @@ convolve_non_gui (GimpDrawable *drawable, ...@@ -657,13 +659,13 @@ convolve_non_gui (GimpDrawable *drawable,
for (i = 1; i < num_strokes; i++) for (i = 1; i < num_strokes; i++)
{ {
non_gui_paint_core.curx = stroke_array[i * 2 + 0]; non_gui_paint_core.cur_coords.x = stroke_array[i * 2 + 0];
non_gui_paint_core.cury = stroke_array[i * 2 + 1]; non_gui_paint_core.cur_coords.y = stroke_array[i * 2 + 1];
paint_core_interpolate (&non_gui_paint_core, drawable); paint_core_interpolate (&non_gui_paint_core, drawable);
non_gui_paint_core.lastx = non_gui_paint_core.curx; non_gui_paint_core.last_coords.x = non_gui_paint_core.cur_coords.x;
non_gui_paint_core.lasty = non_gui_paint_core.cury; non_gui_paint_core.last_coords.y = non_gui_paint_core.cur_coords.y;
} }
paint_core_finish (&non_gui_paint_core, drawable, -1); paint_core_finish (&non_gui_paint_core, drawable, -1);
......
...@@ -377,7 +377,7 @@ gimp_dodgeburn_tool_motion (GimpPaintTool *paint_tool, ...@@ -377,7 +377,7 @@ gimp_dodgeburn_tool_motion (GimpPaintTool *paint_tool,
return; return;
if (pressure_options->size) if (pressure_options->size)
scale = paint_tool->curpressure; scale = paint_tool->cur_coords.pressure;
else else
scale = 1.0; scale = 1.0;
...@@ -442,7 +442,7 @@ gimp_dodgeburn_tool_motion (GimpPaintTool *paint_tool, ...@@ -442,7 +442,7 @@ gimp_dodgeburn_tool_motion (GimpPaintTool *paint_tool,
255 * gimp_context_get_opacity (gimp_get_current_context (gimage->gimp)); 255 * gimp_context_get_opacity (gimp_get_current_context (gimage->gimp));
if (pressure_options->opacity) if (pressure_options->opacity)
opacity = opacity * 2.0 * paint_tool->curpressure; opacity = opacity * 2.0 * paint_tool->cur_coords.pressure;
/* Replace the newly dodgedburned area (canvas_buf) to the gimage*/ /* Replace the newly dodgedburned area (canvas_buf) to the gimage*/
gimp_paint_tool_replace_canvas (paint_tool, drawable, gimp_paint_tool_replace_canvas (paint_tool, drawable,
...@@ -582,20 +582,20 @@ gimp_dodgeburn_tool_non_gui (GimpDrawable *drawable, ...@@ -582,20 +582,20 @@ gimp_dodgeburn_tool_non_gui (GimpDrawable *drawable,
non_gui_lut, non_gui_lut,
drawable); drawable);
paint_tool->startx = paint_tool->lastx = stroke_array[0]; paint_tool->start_coords.x = paint_tool->last_coords.x = stroke_array[0];
paint_tool->starty = paint_tool->lasty = stroke_array[1]; paint_tool->start_coords.y = paint_tool->last_coords.y = stroke_array[1];
gimp_dodgeburn_tool_paint (paint_tool, drawable, MOTION_PAINT); gimp_dodgeburn_tool_paint (paint_tool, drawable, MOTION_PAINT);
for (i = 1; i < num_strokes; i++) for (i = 1; i < num_strokes; i++)
{ {
paint_tool->curx = stroke_array[i * 2 + 0]; paint_tool->cur_coords.x = stroke_array[i * 2 + 0];
paint_tool->cury = stroke_array[i * 2 + 1]; paint_tool->cur_coords.y = stroke_array[i * 2 + 1];
gimp_paint_tool_interpolate (paint_tool, drawable); gimp_paint_tool_interpolate (paint_tool, drawable);
paint_tool->lastx = paint_tool->curx; paint_tool->last_coords.x = paint_tool->cur_coords.x;
paint_tool->lasty = paint_tool->cury; paint_tool->last_coords.y = paint_tool->cur_coords.y;
} }
gimp_paint_tool_finish (paint_tool, drawable); gimp_paint_tool_finish (paint_tool, drawable);
......
...@@ -291,7 +291,7 @@ gimp_eraser_tool_motion (GimpPaintTool *paint_tool, ...@@ -291,7 +291,7 @@ gimp_eraser_tool_motion (GimpPaintTool *paint_tool,
context = gimp_get_current_context (gimage->gimp); context = gimp_get_current_context (gimage->gimp);
if (pressure_options->size) if (pressure_options->size)
scale = paint_tool->curpressure; scale = paint_tool->cur_coords.pressure;
else else
scale = 1.0; scale = 1.0;
...@@ -311,7 +311,7 @@ gimp_eraser_tool_motion (GimpPaintTool *paint_tool, ...@@ -311,7 +311,7 @@ gimp_eraser_tool_motion (GimpPaintTool *paint_tool,
opacity = 255 * gimp_context_get_opacity (context); opacity = 255 * gimp_context_get_opacity (context);
if (pressure_options->opacity) if (pressure_options->opacity)
opacity = opacity * 2.0 * paint_tool->curpressure; opacity = opacity * 2.0 * paint_tool->cur_coords.pressure;
/* paste the newly painted canvas to the gimage which is being /* paste the newly painted canvas to the gimage which is being
* worked on */ * worked on */
...@@ -400,7 +400,7 @@ gimp_eraser_tool_motion (GimpPaintTool *paint_tool, ...@@ -400,7 +400,7 @@ gimp_eraser_tool_motion (GimpPaintTool *paint_tool,
opacity = 255 * gimp_context_get_opacity (context); opacity = 255 * gimp_context_get_opacity (context);
if (pressure_options->opacity) if (pressure_options->opacity)
opacity = opacity * 2.0 * paint_tool->curpressure; opacity = opacity * 2.0 * paint_tool->cur_coords.pressure;
/* paste the newly painted canvas to the gimage which is /* paste the newly painted canvas to the gimage which is
* being worked on */ * being worked on */
...@@ -470,20 +470,20 @@ eraser_non_gui (GimpDrawable *drawable, ...@@ -470,20 +470,20 @@ eraser_non_gui (GimpDrawable *drawable,
non_gui_anti_erase = anti_erase; non_gui_anti_erase = anti_erase;
non_gui_color_erase = color_erase; non_gui_color_erase = color_erase;
paint_tool->startx = paint_tool->lastx = stroke_array[0]; paint_tool->start_coords.x = paint_tool->last_coords.x = stroke_array[0];
paint_tool->starty = paint_tool->lasty = stroke_array[1]; paint_tool->start_coords.y = paint_tool->last_coords.y = stroke_array[1];
gimp_paint_tool_paint (paint_tool, drawable, MOTION_PAINT); gimp_paint_tool_paint (paint_tool, drawable, MOTION_PAINT);
for (i = 1; i < num_strokes; i++) for (i = 1; i < num_strokes; i++)
{ {
paint_tool->curx = stroke_array[i * 2 + 0]; paint_tool->cur_coords.x = stroke_array[i * 2 + 0];
paint_tool->cury = stroke_array[i * 2 + 1]; paint_tool->cur_coords.y = stroke_array[i * 2 + 1];
gimp_paint_tool_interpolate (paint_tool, drawable); gimp_paint_tool_interpolate (paint_tool, drawable);
paint_tool->lastx = paint_tool->curx; paint_tool->last_coords.x = paint_tool->cur_coords.x;
paint_tool->lasty = paint_tool->cury; paint_tool->last_coords.y = paint_tool->cur_coords.y;
} }
gimp_paint_tool_finish (paint_tool, drawable); gimp_paint_tool_finish (paint_tool, drawable);
......
...@@ -273,7 +273,7 @@ gimp_paintbrush_tool_motion (GimpPaintTool *paint_tool, ...@@ -273,7 +273,7 @@ gimp_paintbrush_tool_motion (GimpPaintTool *paint_tool,
context = gimp_get_current_context (gimage->gimp); context = gimp_get_current_context (gimage->gimp);
if (pressure_options->size) if (pressure_options->size)
scale = paint_tool->curpressure; scale = paint_tool->cur_coords.pressure;
else else
scale = 1.0; scale = 1.0;
...@@ -307,7 +307,7 @@ gimp_paintbrush_tool_motion (GimpPaintTool *paint_tool, ...@@ -307,7 +307,7 @@ gimp_paintbrush_tool_motion (GimpPaintTool *paint_tool,
if (pressure_options->color) if (pressure_options->color)
gimp_gradient_get_color_at (gradient, gimp_gradient_get_color_at (gradient,
paint_tool->curpressure, paint_tool->cur_coords.pressure,
&color); &color);
else else
gimp_paint_tool_get_color_from_gradient (paint_tool, gimp_paint_tool_get_color_from_gradient (paint_tool,
...@@ -351,7 +351,7 @@ gimp_paintbrush_tool_motion (GimpPaintTool *paint_tool, ...@@ -351,7 +351,7 @@ gimp_paintbrush_tool_motion (GimpPaintTool *paint_tool,
opacity = (gdouble) temp_blend; opacity = (gdouble) temp_blend;
if (pressure_options->opacity) if (pressure_options->opacity)
opacity = opacity * 2.0 * paint_tool->curpressure; opacity = opacity * 2.0 * paint_tool->cur_coords.pressure;
gimp_paint_tool_paste_canvas (paint_tool, drawable, gimp_paint_tool_paste_canvas (paint_tool, drawable,
MIN (opacity, 255), MIN (opacity, 255),
...@@ -389,20 +389,20 @@ gimp_paintbrush_tool_non_gui_default (GimpDrawable *drawable, ...@@ -389,20 +389,20 @@ gimp_paintbrush_tool_non_gui_default (GimpDrawable *drawable,
stroke_array[0], stroke_array[0],
stroke_array[1])) stroke_array[1]))
{ {
paint_tool->startx = paint_tool->lastx = stroke_array[0]; paint_tool->start_coords.x = paint_tool->last_coords.x = stroke_array[0];
paint_tool->starty = paint_tool->lasty = stroke_array[1]; paint_tool->start_coords.y = paint_tool->last_coords.y = stroke_array[1];
gimp_paint_tool_paint (paint_tool, drawable, MOTION_PAINT); gimp_paint_tool_paint (paint_tool, drawable, MOTION_PAINT);
for (i = 1; i < num_strokes; i++) for (i = 1; i < num_strokes; i++)
{ {
paint_tool->curx = stroke_array[i * 2 + 0]; paint_tool->cur_coords.x = stroke_array[i * 2 + 0];
paint_tool->cury = stroke_array[i * 2 + 1]; paint_tool->cur_coords.y = stroke_array[i * 2 + 1];
gimp_paint_tool_interpolate (paint_tool, drawable); gimp_paint_tool_interpolate (paint_tool, drawable);
paint_tool->lastx = paint_tool->curx; paint_tool->last_coords.x = paint_tool->cur_coords.x;
paint_tool->lasty = paint_tool->cury; paint_tool->last_coords.y = paint_tool->cur_coords.y;
} }
gimp_paint_tool_finish (paint_tool, drawable); gimp_paint_tool_finish (paint_tool, drawable);
...@@ -441,20 +441,20 @@ gimp_paintbrush_tool_non_gui (GimpDrawable *drawable, ...@@ -441,20 +441,20 @@ gimp_paintbrush_tool_non_gui (GimpDrawable *drawable,
non_gui_gradient_options.gradient_type = LOOP_TRIANGLE; non_gui_gradient_options.gradient_type = LOOP_TRIANGLE;
non_gui_incremental = method; non_gui_incremental = method;
paint_tool->startx = paint_tool->lastx = stroke_array[0]; paint_tool->start_coords.x = paint_tool->last_coords.x = stroke_array[0];
paint_tool->starty = paint_tool->lasty = stroke_array[1]; paint_tool->start_coords.y = paint_tool->last_coords.y = stroke_array[1];
gimp_paint_tool_paint (paint_tool, drawable, MOTION_PAINT); gimp_paint_tool_paint (paint_tool, drawable, MOTION_PAINT);
for (i = 1; i < num_strokes; i++) for (i = 1; i < num_strokes; i++)
{ {
paint_tool->curx = stroke_array[i * 2 + 0]; paint_tool->cur_coords.x = stroke_array[i * 2 + 0];
paint_tool->cury = stroke_array[i * 2 + 1]; paint_tool->cur_coords.y = stroke_array[i * 2 + 1];