From 17bc3ae168964c0d60aa3ab38c2d2db50f01b4fa Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Mon, 16 Apr 2001 02:06:57 +0000 Subject: Made setting the rgba color work even if you're using the non-aa canvas 2001-04-15 Christopher James Lahey * gal/e-text/e-text.c: Made setting the rgba color work even if you're using the non-aa canvas (except for the a.) svn path=/trunk/; revision=9337 --- widgets/text/e-text.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'widgets/text') diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index 0de86fbec2..e59bde6b7f 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -1378,10 +1378,7 @@ e_text_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) (color.green & 0xff00) << 8 | (color.blue & 0xff00) | 0xff); - text->color = color; color_changed = TRUE; - text->needs_redraw = 1; - needs_update = 1; break; case ARG_FILL_COLOR_GDK: @@ -1394,17 +1391,15 @@ e_text_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) (color.green & 0xff00) << 8 | (color.blue & 0xff00) | 0xff); - text->color = color; color_changed = TRUE; - text->needs_redraw = 1; - needs_update = 1; break; case ARG_FILL_COLOR_RGBA: text->rgba = GTK_VALUE_UINT (*arg); + color.red = ((text->rgba >> 24) & 0xff) * 0x101; + color.green = ((text->rgba >> 16) & 0xff) * 0x101; + color.blue = ((text->rgba >> 8) & 0xff) * 0x101; color_changed = TRUE; - text->needs_redraw = 1; - needs_update = 1; break; case ARG_FILL_STIPPLE: @@ -1511,9 +1506,13 @@ e_text_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) if (GNOME_CANVAS_ITEM_REALIZED & GTK_OBJECT_FLAGS(item)) gdk_color_context_query_color (item->canvas->cc, &color); + text->color = color; + if (!item->canvas->aa) set_text_gc_foreground (text); + text->needs_redraw = 1; + needs_update = 1; } if ( needs_reflow ) -- cgit v1.2.3