Commit 23dab431 authored by Ell's avatar Ell

Bug 796153 - Airbrush doesn't paint on timeout, and crashes with dynamics

gimp_airbrush_stamp(), which is called during the airbrush timeout
to periodically stamp the airbrush, assumes the saved symmetry's
origin is the same as during the original call to
gimp_airbrush_paint().  However, since commit
bc09c718, we clear the symmetry's
origin at the end of gimp_paint_core_paint(), resulting in an empty
symmetry with a NULL origin during gimp_airbrush_stamp().  As a
result, no dab is painted, and we segfault if there's active
dynamics.

Fix this by saving the symmetry's origin coords during
gimp_airbrush_paint(), and restoring them in gimp_airbrush_stamp().
parent 320d23f9
......@@ -170,6 +170,8 @@ gimp_airbrush_paint (GimpPaintCore *paint_core,
/* Base our timeout on the original stroke. */
coords = gimp_symmetry_get_origin (sym);
airbrush->coords = *coords;
dynamic_rate = gimp_dynamics_get_linear_value (dynamics,
GIMP_DYNAMICS_OUTPUT_RATE,
coords,
......@@ -246,9 +248,14 @@ gimp_airbrush_stamp (GimpAirbrush *airbrush)
{
g_return_if_fail (GIMP_IS_AIRBRUSH (airbrush));
gimp_symmetry_set_origin (airbrush->sym,
airbrush->drawable, &airbrush->coords);
gimp_airbrush_paint (GIMP_PAINT_CORE (airbrush),
airbrush->drawable,
airbrush->paint_options,
airbrush->sym,
GIMP_PAINT_STATE_MOTION, 0);
gimp_symmetry_clear_origin (airbrush->sym);
}
......@@ -41,6 +41,7 @@ struct _GimpAirbrush
GimpSymmetry *sym;
GimpDrawable *drawable;
GimpPaintOptions *paint_options;
GimpCoords coords;
};
struct _GimpAirbrushClass
......
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