Commit 45c835aa authored by Alexia Death's avatar Alexia Death

app: Add API to remove all background curves from the curve view

Also, use this change in cuves tool.
parent 1e26bb13
......@@ -785,12 +785,7 @@ gimp_curves_tool_config_notify (GObject *object,
gimp_color_bar_set_channel (GIMP_COLOR_BAR (tool->yrange),
config->channel);
gimp_curve_view_remove_background (GIMP_CURVE_VIEW (tool->graph),
config->curve[GIMP_HISTOGRAM_RED]);
gimp_curve_view_remove_background (GIMP_CURVE_VIEW (tool->graph),
config->curve[GIMP_HISTOGRAM_GREEN]);
gimp_curve_view_remove_background (GIMP_CURVE_VIEW (tool->graph),
config->curve[GIMP_HISTOGRAM_BLUE]);
gimp_curve_view_remove_all_backgrounds (GIMP_CURVE_VIEW (tool->graph));
gimp_rgb_set (&red, 1.0, 0.0, 0.0);
gimp_rgb_set (&green, 0.0, 1.0, 0.0);
......
......@@ -1188,6 +1188,27 @@ gimp_curve_view_remove_background (GimpCurveView *view,
}
}
void
gimp_curve_view_remove_all_backgrounds (GimpCurveView *view)
{
GList *list;
g_return_if_fail (GIMP_IS_CURVE_VIEW (view));
for (list = view->bg_curves; list; list = g_list_next (list))
{
BGCurve *bg = list->data;
g_object_unref (bg->curve);
view->bg_curves = g_list_remove (view->bg_curves, bg);
g_slice_free (BGCurve, bg);
}
gtk_widget_queue_draw (GTK_WIDGET (view));
}
void
gimp_curve_view_set_selected (GimpCurveView *view,
gint selected)
......
......@@ -93,6 +93,8 @@ void gimp_curve_view_add_background (GimpCurveView *view,
void gimp_curve_view_remove_background (GimpCurveView *view,
GimpCurve *curve);
void gimp_curve_view_remove_all_backgrounds (GimpCurveView *view);
void gimp_curve_view_set_selected (GimpCurveView *view,
gint selected);
void gimp_curve_view_set_range_x (GimpCurveView *view,
......
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