[gimp] app: don't pass the GtkStyle to gimp_curve_view_draw_grid()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: don't pass the GtkStyle to gimp_curve_view_draw_grid()
- Date: Tue, 11 Jan 2011 14:40:06 +0000 (UTC)
commit 229007106e3fbdadbc7bb731124601f65b7e7de7
Author: Michael Natterer <mitch gimp org>
Date: Tue Jan 11 15:38:23 2011 +0100
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.
app/widgets/gimpcurveview.c | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/app/widgets/gimpcurveview.c b/app/widgets/gimpcurveview.c
index f02aeb9..04f55fc 100644
--- a/app/widgets/gimpcurveview.c
+++ b/app/widgets/gimpcurveview.c
@@ -333,7 +333,6 @@ gimp_curve_view_style_set (GtkWidget *widget,
static void
gimp_curve_view_draw_grid (GimpCurveView *view,
- GtkStyle *style,
cairo_t *cr,
gint width,
gint height,
@@ -341,8 +340,6 @@ gimp_curve_view_draw_grid (GimpCurveView *view,
{
gint i;
- gdk_cairo_set_source_color (cr, &style->dark[GTK_STATE_NORMAL]);
-
for (i = 1; i < view->grid_rows; i++)
{
gint y = i * (height - 1) / view->grid_rows;
@@ -486,10 +483,6 @@ gimp_curve_view_expose (GtkWidget *widget,
gdk_cairo_region (cr, event->region);
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))
{
gtk_paint_focus (style, window,
@@ -499,8 +492,14 @@ gimp_curve_view_expose (GtkWidget *widget,
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 */
- 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 */
for (list = view->bg_curves; list; list = g_list_next (list))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]