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
bc09c71818, 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().
This commit is contained in:
Ell 2018-05-16 14:29:47 -04:00
parent 320d23f964
commit 23dab4311a
2 changed files with 8 additions and 0 deletions

View File

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

View File

@ -41,6 +41,7 @@ struct _GimpAirbrush
GimpSymmetry *sym;
GimpDrawable *drawable;
GimpPaintOptions *paint_options;
GimpCoords coords;
};
struct _GimpAirbrushClass