app: don't pass the GtkStyle to gimp_curve_view_draw_grid()
Instead, set the cairo color in expose() before calling draw_grid(). Also move a few lines of code around to make the GTK3 port simpler.
This commit is contained in:
@ -333,7 +333,6 @@ gimp_curve_view_style_set (GtkWidget *widget,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_curve_view_draw_grid (GimpCurveView *view,
|
gimp_curve_view_draw_grid (GimpCurveView *view,
|
||||||
GtkStyle *style,
|
|
||||||
cairo_t *cr,
|
cairo_t *cr,
|
||||||
gint width,
|
gint width,
|
||||||
gint height,
|
gint height,
|
||||||
@ -341,8 +340,6 @@ gimp_curve_view_draw_grid (GimpCurveView *view,
|
|||||||
{
|
{
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
gdk_cairo_set_source_color (cr, &style->dark[GTK_STATE_NORMAL]);
|
|
||||||
|
|
||||||
for (i = 1; i < view->grid_rows; i++)
|
for (i = 1; i < view->grid_rows; i++)
|
||||||
{
|
{
|
||||||
gint y = i * (height - 1) / view->grid_rows;
|
gint y = i * (height - 1) / view->grid_rows;
|
||||||
@ -486,10 +483,6 @@ gimp_curve_view_expose (GtkWidget *widget,
|
|||||||
gdk_cairo_region (cr, event->region);
|
gdk_cairo_region (cr, event->region);
|
||||||
cairo_clip (cr);
|
cairo_clip (cr);
|
||||||
|
|
||||||
cairo_set_line_width (cr, 1.0);
|
|
||||||
cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
|
|
||||||
cairo_translate (cr, 0.5, 0.5);
|
|
||||||
|
|
||||||
if (gtk_widget_has_focus (widget))
|
if (gtk_widget_has_focus (widget))
|
||||||
{
|
{
|
||||||
gtk_paint_focus (style, window,
|
gtk_paint_focus (style, window,
|
||||||
@ -499,8 +492,14 @@ gimp_curve_view_expose (GtkWidget *widget,
|
|||||||
width + 4, height + 4);
|
width + 4, height + 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cairo_set_line_width (cr, 1.0);
|
||||||
|
cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
|
||||||
|
cairo_translate (cr, 0.5, 0.5);
|
||||||
|
|
||||||
/* Draw the grid lines */
|
/* Draw the grid lines */
|
||||||
gimp_curve_view_draw_grid (view, style, cr, width, height, border);
|
gdk_cairo_set_source_color (cr, &style->dark[GTK_STATE_NORMAL]);
|
||||||
|
|
||||||
|
gimp_curve_view_draw_grid (view, cr, width, height, border);
|
||||||
|
|
||||||
/* Draw the background curves */
|
/* Draw the background curves */
|
||||||
for (list = view->bg_curves; list; list = g_list_next (list))
|
for (list = view->bg_curves; list; list = g_list_next (list))
|
||||||
|
Reference in New Issue
Block a user