diff --git a/ChangeLog b/ChangeLog index 98bb7d24a5..fe2c9fa35a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-02-10 Sven Neumann + + * app/core/gimpcoords-interpolate.c + * app/core/gimpbrush-transform.c + * app/paint/gimppaintoptions.c + * app/display/gimpdisplayshell-coords.c: applied patch from Alexia + Death that fixes the direction of brush rotation (bug #520078). + 2009-02-10 Sven Neumann * app/display/gimpdisplayshell-coords.c diff --git a/app/core/gimpbrush-transform.c b/app/core/gimpbrush-transform.c index e25ff00ce4..56bbee85ee 100644 --- a/app/core/gimpbrush-transform.c +++ b/app/core/gimpbrush-transform.c @@ -205,7 +205,7 @@ gimp_brush_transform_matrix (GimpBrush *brush, gimp_matrix3_identity (matrix); gimp_matrix3_translate (matrix, - center_x, - center_x); - gimp_matrix3_rotate (matrix, 2 * G_PI * angle); + gimp_matrix3_rotate (matrix, -2 * G_PI * angle); gimp_matrix3_translate (matrix, center_x, center_y); gimp_matrix3_scale (matrix, scale, scale); } diff --git a/app/core/gimpcoords-interpolate.c b/app/core/gimpcoords-interpolate.c index ae6062d8c3..657e38d3ec 100644 --- a/app/core/gimpcoords-interpolate.c +++ b/app/core/gimpcoords-interpolate.c @@ -40,11 +40,11 @@ static void gimp_coords_interpolate_bezier_internal (const GimpCoords bezie GArray **ret_coords, GArray **ret_params, gint depth); -static gdouble gimp_coords_get_catmull_spline_point (gdouble t, - gdouble p0, - gdouble p1, - gdouble p2, - gdouble p3); +static gdouble gimp_coords_get_catmull_spline_point (const gdouble t, + const gdouble p0, + const gdouble p1, + const gdouble p2, + const gdouble p3); /* Functions for bezier subdivision */ @@ -226,15 +226,15 @@ gimp_coords_interpolate_catmull (const GimpCoords catmul_pt1, GArray **ret_coords, GArray **ret_params) { - gdouble delta_x, delta_y; - gdouble distance; - gint num_points; - gint n; + gdouble delta_x, delta_y; + gdouble distance; + gint num_points; + gint n; - GimpCoords past_coords; - GimpCoords start_coords; - GimpCoords end_coords; - GimpCoords future_coords; + GimpCoords past_coords; + GimpCoords start_coords; + GimpCoords end_coords; + GimpCoords future_coords; delta_x = catmul_pt3.x - catmul_pt2.x; delta_y = catmul_pt3.y - catmul_pt2.y; @@ -323,7 +323,7 @@ gimp_coords_interpolate_catmull (const GimpCoords catmul_pt1, } else { - res_coords.direction = atan (delta_y / delta_x) / (2 * G_PI); + res_coords.direction = atan ((- delta_y) / delta_x) / (2 * G_PI); if (delta_x > 0.0) res_coords.direction = res_coords.direction + 0.5; @@ -337,11 +337,11 @@ gimp_coords_interpolate_catmull (const GimpCoords catmul_pt1, } static gdouble -gimp_coords_get_catmull_spline_point (gdouble t, - gdouble p0, - gdouble p1, - gdouble p2, - gdouble p3) +gimp_coords_get_catmull_spline_point (const gdouble t, + const gdouble p0, + const gdouble p1, + const gdouble p2, + const gdouble p3) { return ((((-t + 2.0) * t - 1.0) * t / 2.0) * p0 + diff --git a/app/display/gimpdisplayshell-coords.c b/app/display/gimpdisplayshell-coords.c index 8dece2373a..2d6f5621f8 100644 --- a/app/display/gimpdisplayshell-coords.c +++ b/app/display/gimpdisplayshell-coords.c @@ -298,12 +298,13 @@ gimp_display_shell_eval_event (GimpDisplayShell *shell, } else { - coords->direction = atan (delta_y / delta_x) / (2 * G_PI); - if (delta_x > 0.0) + coords->direction = atan ((- 1.0 * delta_y) / delta_x) / (2 * G_PI); + if (delta_x < 0.0) coords->direction = coords->direction + 0.5; } delta_dir = coords->direction - shell->last_coords.direction; + if ((fabs (delta_dir) > 0.5) && (delta_dir < 0.0)) coords->direction = 0.3 * coords->direction + 0.7 * (shell->last_coords.direction - 1.0); else if ((fabs (delta_dir) > 0.5) && (delta_dir > 0.0)) diff --git a/app/paint/gimppaintoptions.c b/app/paint/gimppaintoptions.c index f45d5fd0e9..9c9b2e4e8b 100644 --- a/app/paint/gimppaintoptions.c +++ b/app/paint/gimppaintoptions.c @@ -503,7 +503,7 @@ gimp_paint_options_set_property (GObject *object, break; case PROP_BRUSH_ANGLE: - options->brush_angle = g_value_get_double (value) / 360.0; + options->brush_angle = - 1.0 * g_value_get_double (value) / 360.0; /* let's make the angle mathematically correct */ break; case PROP_APPLICATION_MODE: @@ -742,7 +742,7 @@ gimp_paint_options_get_property (GObject *object, break; case PROP_BRUSH_ANGLE: - g_value_set_double (value, options->brush_angle * 360.0); + g_value_set_double (value, - 1.0 * options->brush_angle * 360.0); /* mathematically correct -> intuitively correct */ break; case PROP_APPLICATION_MODE: